2015-01-15 09:53 AM
These forums are great, thanks in advance for all your help!
I'm using an STM32F439, no IDE has been picked yet, but either Keil or IARMy application involves swappable FLASH (or EEPROM) boards that contain the program running. I am going to write a bootloader (many examples here) to do that by reprogramming the flash at address 0x8000 C000.I know that in the application which is bootstrapped I need to move the NVIC table.My question is, when I compile this program, do I simply edit the linker script to tell it it starts at location C000 instead of 0?Also, how do I get this compiled binary on the cartridge? Can I plug the cartridge in (to the memory map), modify the linker in a similar way (starting program location vs execute location), program it, and remove the flash cart?Thank you so much #stm32f #flash #bootloader2015-01-15 11:54 AM
Executing from external memory will be VERY slow.
You should build for 0x0800C000 rather than 0xC000, less likely to be issues with shadowing if you build/run at the memory's native address. You'd reprogram SCB->VTOR with the base address of the vector table. In ST's Standard Peripheral Library this typically gets done in SystemInit(), and is often overlooked when people modify the scatter file or linker script. Suggest you review the IAP examples, including how the Discovery Upgrade example which pulls a firmware image from a USB Flash Stick.2015-01-15 12:56 PM
Thanks, you're right the physical hardware address is much better.
I understand I change the vector table offset register, but I'm not certain I know what you mean by scb->vtorI'll look at those examples, thanks!2015-01-15 01:44 PM
Googling scb->vtor
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHHDGBC.html
Cause it's in the SCB not the NVIC...2015-01-15 02:17 PM
Thanks, clive1
I guess my googling skills are a little off today XDI appreciate you taking the time to help me out.The last thing I need to be able to do before I am 100% confident is program the external NOR flash with the program to be booted. I know this can be done similarly to IAP except writing to the external NOR flash after setting up the FMC and writing to it, however it would make my life MUCH easier if I could use the jtag to do it, perhaps there is some sort of tool that already exists to save me having to write this?I have been googling for an hour or so, so it could be I don't know the right terminology.Thanks a bunch2015-01-15 04:09 PM
Segger has there J-Flash application. For CFI compatible memory devices you need to configure the memory interface to the point it can recognize the NOR/NAND device from it's MFG ID, etc. As I recall it uses scripting to program the CPU/Peripherals.
In Keil you create and load flash applets for specific memory regions by selecting them in the ''Algorithm'' option in the Options->Debug Setting->Flash configuration. The applets load as small code routines that are JTAG'd and run from flash, and configure the processor, clocks, pins, external buses and memory devices.2015-01-15 04:19 PM
https://www.segger.com/jflash.html
http://www.keil.com/support/man/docs/uv4/uv4_fl_flash_algorithms.htm
http://www.keil.com/support/man/docs/ulink2/ulink2_su_newalgorithms.htm
http://www.keil.com/support/man/docs/ulink2/ulink2_su_programming_algorithm.htm
2015-01-16 01:48 AM
Thanks very much