I'm planning a design for a custom secondary bootloader for the 28335 and I would appreciate a sanity check. Here are my requirements:
- Only UART is available in production
- Application must be stored in flash
- Several other blocks of arbitrary data must be stored in flash, each block individually erasable/programmable (separate sectors)
- Bootloader must have a "passthrough" mode that passes data from UART out to a different peripheral
The concept is as follows:
- Under normal circumstances, boot ROM jumps to flash and runs the main application
- When the boot ROM is configured for SCI boot mode via GPIO pins:
- For application, host uses a program like SDFlash with RS232 serial patch to program via boot ROM
- For data, host sends an entry point address which I've specified via linker script to be the address of the secondary bootloader "boot_main", then re-establishes UART to erase/program flash via flash API, pass through data, etc.
I'd like for the firmware and the secondary bootloader to be in the same CCS project as the application. The alternative would be to maintain a separate bootloader project and load it into RAM via boot ROM, but I'd like to avoid having two separate projects if possible. My main question then is, will sending what is essentially a "jump to secondary bootloader" command to the boot ROM work? That is, if I place my "boot_main" function at a specific address via the linker, then send that address as the entry point to the boot ROM, are there other considerations I should know about? I know that typically the boot ROM jumps to code_start which then calls _c_int00 for C initialization (and it calls main), so is there a way to achieve what I've described?