Commit Graph

9 Commits

Author SHA1 Message Date
Doug Brown
257d395cd2 Bypass GCC built-in startup code
Nuvoton's sample startup_M251.S file handles enough initialization for
my purposes, so I can completely bypass _start and jump directly to
main. Note that I also had to add a define to enable clearing of BSS.
2023-06-25 11:41:19 -07:00
Doug Brown
71af23b33e Strip out unnecessary clock and UART code
The default values for SystemCoreClock, CyclesPerUs, and PllClock work
fine for my purposes of running from the 48 MHz HIRC. Remove unnecessary
initialization code. This is especially useful for the bootloader where
flash space is at a premium.

Also strip out unneeded UART setup code.
2023-06-25 11:41:19 -07:00
Doug Brown
3a7e3bf69f Don't include peripheral header files in M251.h
I don't want to include all of Nuvoton's peripheral drivers, but I do
want to use this header file. Remove the unnecessary peripheral
includes.
2023-06-25 11:41:19 -07:00
Doug Brown
9f0299a9c4 Reserve 4 bytes at end of RAM for magic number
This will be used during firmware updates so that the main firmware can
communicate to the bootloader that it should stay in the bootloader for
a firmware update rather than run the main firmware again.
2023-06-25 11:41:19 -07:00
Doug Brown
7c368aa816 Fix issue with linker script allowing data section to overflow flash 2023-06-25 11:41:19 -07:00
Doug Brown
7a77d583da Update linker scripts with correct RAM/flash sizes
Change code style so that it's easy to see the number of kilobytes too.
2023-06-25 11:41:19 -07:00
Doug Brown
e1e1523a99 Add README explaining the Nuvoton directory 2023-06-25 11:41:19 -07:00
Doug Brown
30e8baef89 Initial commit of Nuvoton USBD driver 2023-06-25 11:41:19 -07:00
Doug Brown
979f531bdf Initial commit of register defines, CMSIS code from Nuvoton BSP 2023-06-25 11:41:19 -07:00