Go to advanced search

by dwelch67
Wed Feb 17, 2021 7:20 pm
Forum: Bare metal, Assembly language
Topic: Programming Pico Flash In-System
Replies: 2
Views: 256

Re: Programming Pico Flash In-System

this is what the bootrom does right now yes? it fakes a thumb drive then takes the uf2 file it reads and extracts the data and writes it to the spi flash. Just do that using whatever method you want to get the data into the memory of the mcu so you can then write it to flash. Can probably borrow the...
by dwelch67
Sun Feb 14, 2021 12:46 am
Forum: Bare metal, Assembly language
Topic: How do I set up SWI on a Pi0?
Replies: 4
Views: 348

Re: How do I set up SWI on a Pi0?

start.s .globl _start _start: ldr pc,reset_handler ldr pc,undefined_handler ldr pc,swi_handler ldr pc,prefetch_handler ldr pc,data_handler ldr pc,unused_handler ldr pc,irq_handler ldr pc,fiq_handler reset_handler: .word reset undefined_handler: .word hang swi_handler: .word doswi prefetch_handler: ....
by dwelch67
Sat Feb 13, 2021 10:46 pm
Forum: Bare metal, Assembly language
Topic: How do I set up SWI on a Pi0?
Replies: 4
Views: 348

Re: How do I set up SWI on a Pi0?

Do I not have an SWI example? (dwelch67)...Let me look into that.
by dwelch67
Sat Feb 13, 2021 10:38 pm
Forum: Bare metal, Assembly language
Topic: How do I set up SWI on a Pi0?
Replies: 4
Views: 348

Re: How do I set up SWI on a Pi0?

1. How do I enable the SWI? handler. The BCM2835 datasheet doesn't seem to mention it at all. SWI is part of the arm core not the broadcom chip. You dont enable the handler you simply execute an swi/svc instruction. 2. How does the SWI handler know which interrupt was generated? Is there a good way ...
by dwelch67
Tue Feb 09, 2021 2:13 am
Forum: Bare metal, Assembly language
Topic: ARM Assembly Bare Metal Using multiple CPU Cores
Replies: 4
Views: 315

Re: ARM Assembly Bare Metal Using multiple CPU Cores

Definitely other folks have examples as well, many of which have at some point been active on this forum. How the 64 bit cores boot definitely had some discussion on this forum...
by dwelch67
Tue Feb 09, 2021 2:11 am
Forum: Bare metal, Assembly language
Topic: ARM Assembly Bare Metal Using multiple CPU Cores
Replies: 4
Views: 315

Re: ARM Assembly Bare Metal Using multiple CPU Cores

Im the dwelch67 from those examples (maybe they are so bad I dont want to admit that). The normal way to boot the full sized pis (now that there is a pico that is completely different) is without a config.txt. The GPU places a small bit of boot code at 0x00000000 to boot the ARM(s). Our kernel(wahte...
by dwelch67
Tue Feb 09, 2021 1:52 am
Forum: Bare metal, Assembly language
Topic: Working C/C++ Pico Toolchain in WSL!
Replies: 6
Views: 458

Re: Working C/C++ Pico Toolchain in WSL!

That is where I got stuck in linux the uf2 and picoasm tools need to be built and as a result the rest of the (blink) example would not build. But no matter I figured out how to use the chip/board bare metal. It has been a couple of weeks so maybe there are more folks out there that got stuck where ...
by dwelch67
Thu Feb 04, 2021 4:07 am
Forum: Bare metal, Assembly language
Topic: STICKY: Bare Metal resources
Replies: 29
Views: 130132

Re: STICKY: Bare Metal resources

https://github.com/dwelch67/raspberrypi-pico

bare metal examples for the pico.
by dwelch67
Tue Feb 02, 2021 2:36 am
Forum: Bare metal, Assembly language
Topic: static vars not initialised
Replies: 24
Views: 1545

Re: static vars not initialised

SECTIONS { .text : { *(.text*) } > ram .rodata : { *(.rodata*) } > ram .bss : { *(.bss*) } > ram .data : { *(.data*) } > ram } note that if you have .data after .bss in the linker script and simply add a single .data item then both .data and .bss will be initialized in the kernel.img file. no extra ...
by dwelch67
Sun Jan 31, 2021 11:24 pm
Forum: Bare metal, Assembly language
Topic: [SOLVED] Sequence 4 not supported
Replies: 6
Views: 411

Re: [SOLVED] Sequence 4 not supported

I think I had the two pis not connected to the same hub so perhaps there was a potential between them. Had issues with one pi and a usb uart board, the pi would not boot properly, reset or power cycle. Changing which set of usb cables fixed it.

https://github.com/dwelch67/raspberrypi-pico
by dwelch67
Sat Jan 30, 2021 3:44 am
Forum: Bare metal, Assembly language
Topic: [SOLVED] Sequence 4 not supported
Replies: 6
Views: 411

Re: Sequence 4 not supported

How does one mark a topic as SOLVED?
by dwelch67
Sat Jan 30, 2021 3:43 am
Forum: General
Topic: UF2 magic
Replies: 7
Views: 509

Re: UF2 magic

I was in part tripping over my own feet. for some reason the bootrom does not expose the flash so the second state loader is expected to and then branch to it (or copy and jump). I can blink an led now.
by dwelch67
Sat Jan 30, 2021 3:42 am
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

https://github.com/dwelch67/raspberrypi-pico

Okay it blinks the led now...mostly tripped over my own feet, finally got around to all of the relevant topics.
by dwelch67
Fri Jan 29, 2021 6:21 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

And the resets are documented, I had not circled back around to that I had spent a day on the uf2 stuff and then stage 2 bootloader then briefly leds and called it a night before looking for reset controls...I should have all the pieces now.

Thanks
David
by dwelch67
Fri Jan 29, 2021 4:44 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

Excellent, thanks!
by dwelch67
Fri Jan 29, 2021 2:53 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

should be visible and should run.
by dwelch67
Fri Jan 29, 2021 2:31 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

independent of all that even if the second stage bootloader is not successful nor bothers trying to re-init the spi flash and open it up. that code should be visible. There is also some other enable or magic with respect to the gpio. repeating what the blink program does to change the function to SI...
by dwelch67
Fri Jan 29, 2021 2:20 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

yes I saw those second stage bootloaders I tried the generic one, no joy. int main() { const uint LED_PIN = 25; gpio_init(LED_PIN); gpio_set_dir(LED_PIN, GPIO_OUT); while (true) { gpio_put(LED_PIN, 1); sleep_ms(250); gpio_put(LED_PIN, 0); sleep_ms(250); } } if I replace the sleep_ms functions with a...
by dwelch67
Fri Jan 29, 2021 4:20 am
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

Okay I see, cant get it working yet...
by dwelch67
Fri Jan 29, 2021 3:43 am
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

It copies the 256 bytes to 0x20041f00
by dwelch67
Thu Jan 28, 2021 9:05 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

Re: pico rf2040 booting

openocd seemed to support some flash sector erasing and writing too and that did not make a difference. Nor did picotool which claimed it did something too. so I suspect there are rules for that secondary bootloader, right now dont care about enabling access to the flash (can you believe it is off c...
by dwelch67
Thu Jan 28, 2021 9:02 pm
Forum: SDK
Topic: [SOLVED] pico rf2040 booting
Replies: 11
Views: 475

[SOLVED] pico rf2040 booting

I am trying to get my pico booted and have hit the next issue. uf2 file format that is all fine and good. the chip docs say the first 256 bytes on flash (address 0x10000000) have a crc32 with certain parameters. I can read and verify the blink example and check the crc32 code. my uf2 file matches th...
by dwelch67
Thu Jan 28, 2021 8:49 pm
Forum: General
Topic: UF2 magic
Replies: 7
Views: 509

Re: UF2 magic

Hmmm the blink example does not have a vector table there 0x00000000: 0x0A324655 0x00000004: 0x9E5D5157 0x00000008: 0x00002000 0x0000000C: 0x10000000 0x00000010: 0x00000100 0x00000014: 0x00000000 0x00000018: 0x00000032 0x0000001C: 0xE48BFF56 0x00000020: 0x4B2FB500 <----- address 0x10000000 0x0000002...
by dwelch67
Thu Jan 28, 2021 3:03 pm
Forum: General
Topic: UF2 magic
Replies: 7
Views: 509

Re: UF2 magic

Yes am trying to do my own thing just like I did on the prior pi's... I am aware that it is a copy and jump thing and not a vector table approach, the documentation and such so far implies 0x10000000 not 0x10000100 but I will look for that, thanks. The SDK sources are not easy to dig through so that...
by dwelch67
Thu Jan 28, 2021 5:46 am
Forum: General
Topic: UF2 magic
Replies: 7
Views: 509

Re: UF2 magic

Doesnt work means. The virtual flash drive disconnects. If I go into openocd. telnet localhost 4444 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger > halt target was in unknown state when halt was requested > mdw 0x10000000 20 0x10000000: 00000000 00000000...

Go to advanced search