candle-usb/candleLight_fw

startup.c is broken - hardfault with large BSS

Closed this issue · 8 comments

see description in #135 (comment)

incidentally, looking at disasm for good build, there's already a _start function that initializes BSS (bss_start to bss_end) with memset. Still looking into what part of newlib-nano would handle initialized data - I think we have redundancy in startup.c that we could get rid of.

I think the problem is the too large data section. See #141 for a fix.

Fixed in 59896b6 via #141 . We still need to initialized .rodata because newlib will not do that for us (it does clear BSS though)

.rodata is read only data, right? Does it live in the ROM?

.rodata is read only data, right? Does it live in the ROM?

my bad, I meant the initialized RAM stuff, .data

My patch replaced the 32-bit manual copy loop by a memcpy(), which takes length in bytes. So everything should be fine?

So everything should be fine?

Yes. We can't get rid of startup.c , but it should work now.