-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked bootloader code #2
base: master
Are you sure you want to change the base?
Conversation
Thanks for the great patch. We will take a look, looks like a ton of great stuff! Thanks, On Jun 5, 2012, at 4:54 PM, nekromant wrote:
|
Yes, thank you very much. I look forward to reading your patches and getting them merged. |
Yes, and please, do double-test the board-specific code against maple targets if you can. I have no maple or maple-clone boards around, so I can't test these. Thanks. Only te-stm32f103ret6kit and mcortex targets are well-tested. The first one is a dev board from terra-electronica.ru ( http://www.terraelectronica.ru/catalog_info.php?ID=1001&CODE=333824 sorry, it's in russian, schematics here: http://www.terraelectronica.ru/files/modules/te-stm32f103/te-stm32f103_red_v100.pdf ). The other one is a huge board of our own design, with no schematics yet published. Some early photos here: http://pics.ncrmnt.org/junk/motor-cortex/ ) |
Hey, I see Xilinx FPGAs in those early photos! Cool. Are you using FSMC for STM32<->FPGA communication? That's our plan for Oak. Thanks for the heads-up re: testing. We'll make sure to try out your code on all of our boards, and I'll send a heads-up to the maintainers of non-LeafLabs boards that have support in the LeafLabs libmaple tree that they should test things as well. |
Yeah, it's FSMC. 8-bits of data and about 14 bits of address + an extra interrupt line, that is expanded into a bunch of software interrupts, depending on what happened in the FPGA. The config is downloaded in slave serial mode (right now) via xmodem to the fpga or from SPI flash attached to STM32. I now want to use DFU for that. This allows dynamic FPGA reconfig at runtime. Bitbanging config takes about a second for xc3s100e-tq144. Basically, my xsscu stuff is a port to bare metal of my linux kernel driver that does the same stuff: http://ncrmnt.org/wp/2011/11/18/configuring-a-xilinx-fpga-from-arm/ |
This is the first patch in series. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
TE board works, maple is broken. Also fixes lots of compiler warnings. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Result is ~5.9KiB. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Add coloring support to Makefile Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
The dfu state machine locks and globals get called in ISR, hence must be volatile. If not, we are screwed. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Looks useless, unless I can get upload code to work Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
te-stm32f103ret6kit: Fix usb descriptors maple: fix config.h to reflect recent core changes Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
No example usages, yet Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Fix flash corruption on copy Add blinks before jump Fix formatting of hardware.c Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
dfu now works 10 times faster! Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Results: ~20KiloBytes/s when downloading to flash Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Flash writing speed is now the bottleneck Implemented DUMMY altsetting for USB performance testing. Results: 490k in 8 secs => ~61Kilobyte/sec. Looks like the max we can get here. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
It screws up ST's SysTickConfig() routine if using stock libs Needs more testing Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
This reverts commit bcf9376. That was a bad idea. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Doing so screws all interrupts in the user app. Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
Signed-off-by: Andrew 'Necromant' Andrianov <[email protected]>
This is my total rework of dfu bootloder code, that might be userful for you.
Most of the 'revolutionary' things are now done, everything should be stable now.
In short, what's changed:
Moved hardware dependant code, easy to add new boards, each can have it's own set of descriptors and start address.
Overall fixes - now works when compiled with -Os, binary as small as 5-6KiB (depending on the feature set)
Tuned dfu poll delays - uploads 80KiB in 3 instead of 20 seconds.
Xilinx Bitbang Serial Uploader driver (yet to be added to mcortex board as an example)
Now easy to add new dfu targets, e.g. fpgas, external memories etc.
Buildsystem: pretty output, support for multiple boards to build in batch, smaller Makefile
Extra RUNAPP altsetting that can be enabled via per-board config - any upload to it results in immediate code execution
I'm still working on getting DFU Upload code running, and adding the SPI flash driver, will send a pull request later.
Regards, Andrew