Commit Graph

11 Commits

Author SHA1 Message Date
Doug Brown
f68c1d1d44 Change USBD_MemCopy to not be static inline
I'm sure it's slightly more efficient as a static inline function, but
it results in less flash usage as a separate function. This is important
for the bootloader where every byte matters.
2023-09-10 05:02:44 -07:00
Doug Brown
2c35f61c88 Strip out unnecessary callbacks and code in USBD driver
This is important for the bootloader. There's a bunch of stuff here we
don't need that unnecessarily bloats the code.
2023-09-10 05:02:44 -07:00
Doug Brown
2a96427047 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-09-10 05:02:44 -07:00
Doug Brown
06f9bbcbe7 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-09-10 05:02:44 -07:00
Doug Brown
0470b9960c 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-09-10 05:02:44 -07:00
Doug Brown
a702106bb3 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-09-10 05:02:44 -07:00
Doug Brown
34f2364840 Fix issue with linker script allowing data section to overflow flash 2023-09-10 05:02:44 -07:00
Doug Brown
78c4068071 Update linker scripts with correct RAM/flash sizes
Change code style so that it's easy to see the number of kilobytes too.
2023-09-10 05:02:44 -07:00
Doug Brown
bc9b0245ba Add README explaining the Nuvoton directory 2023-09-10 05:02:44 -07:00
Doug Brown
a4b17f6601 Initial commit of Nuvoton USBD driver 2023-09-10 05:02:44 -07:00
Doug Brown
81bba67ee3 Initial commit of register defines, CMSIS code from Nuvoton BSP 2023-09-10 05:02:44 -07:00