Go Down

Topic: Arduino Due Initialization (Read 2 times) previous topic - next topic

cmaglie

as you already discovered, the Reset_Handler function is the entry point.

https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/system/CMSIS/Device/ATMEL/sam3xa/source/gcc/startup_sam3xa.c#L244

I also patched the file above:

https://github.com/arduino/Arduino/commit/d994e48c5565a0c7aea54384a1b15a19623fe209

the reason is that __libc_init_array() initializes all static c++ objects (by calling their constructor), and some libraries
(for instance LiquidCrystal) uses delay() inside constructors, and delay() didnt work (hangs the CPU) if the hardware is not
initalized before.

C

C.

Go Up