Problems trying to boot from SPIFI (Non supported dev board)
Hi
Once again I'm testing Rowley Crossworks for ARM (Interested on Personal License). Before diving into my question I must state that I'm using Crossworks for ARM with a non-supported board (Bambino 210E from Micromint USA) so, I want to make clear is not my intention to abuse or use Rowley's support as use as board bring-up engineers and if that's the case please ignore/delete this request.
My Bambino 210E dev board comes with an LPC4330 so I used the wizard for NXP LPC4330 executable while creating a new project, by default the project is setup to run from RAM and it works quite well, but when I try to configure the project to run from SPIFI it just won't work.
Now from previous experience when I was testing crossworks with an LPC Link 2 as target I know that the microcontroller needs to be configured to boot in DFU mode otherwise I will get the "Loader is not a LIBMEM RPC loader"error, so my bambino board is setup accordingly (LPC BASED USB DEVICE appears in device manager with no error or exclamation signs). I'm also using the SPIFI_Loader.elf from the LPC4330 Explorer board pack in the "loader file path" property of my project and defined "SPIFI_SIZE=0x400000 SPIFI_CM0_SIZE=0x200000" (Bambino 210E comes with 8M QSPIFI chip from Winbond), then set "section placement from RAM to SPIFI.
With the setup described above I got the error "loader error: spifi_init failed", this error suggest that my project might be missing some parameter but after consulting the crosswork help I found nothing, in fact help entries for the LPC Link 2 and LPC4330 support packages says that in order to run from spifi I only need to "set SPIFI placement" in the project properties.
I'm lost at this point and tried the normal suggestion as per forum: debug adapter speed reduction (normally using 1000000Hz but also tried down to 1000Hz), heap and stack size encrease (up to 1024)
Debug Adapter: LPC Link 2 with J-Link firmware in JTAG mode (tried with CMSIS-DAP firmware as well)
Hope you can point me in the right direction
Tanks in advance
-
Hi Michael, yes... if I use the LPC4330 Xplorer wizard the project works fine! But I'm just trying to figure out the steps needed to start my project from the generic LPC4300 wizard! Currently I'm having a look at the SPIFI_Loader project to try to understand how it works! more exactly to try to understand why I need to put the board in DFU mode! (as a hobbyist I'm not required to understand this but I think is a good way to learn more about Cortex-M MCUs)
Thanks
-
I modified the ResetCM4() function as per your suggestion but unfortunately it didn't work! (importing LPC4300_Target.js before edited)
The good news is that using a Diff tool I managed to figure out what I was missing and got a working project for my bambino board based on generic LPC4300 wizard. This is the procedure:
1.- Create a new project and select the template "An executable for NXP LPC4300", typed project name and location folder as required.
2.- On the "common project settings" changed the "Target Processor" to LPC4330 and click on finish
3.- On the project's properties windows I set the "section placement" to "SPIFI", and add the definition "SPIFI_SIZE=0x800000" to "Memory Map Macros" field (under Build Options). Then I close Crossstudio saving all changes.
4.- Then using Notepad++ I edited the project .hzp file and added the following piece of xml at the end of the file, just above the item "Flash" or before the line "</solution>"
<configuration
Name="SPIFI"
arm_target_flash_loader_file_path="$(TargetsDir)/NGX_LPC4330_Xplorer/Release/SPIFI_Loader.elf"
arm_target_flash_loader_type="LIBMEM RPC Loader"
arm_target_loader_can_lock_all="No"
arm_target_loader_can_lock_range="No"
arm_target_loader_can_unlock_all="No"
arm_target_loader_can_unlock_range="No"
arm_target_loader_reset_after_download="No"
hidden="Yes"
target_loader_reset_script="SPIFIReset(4)" />5.- Open the project in crossstudio again and replace the content of LPC4300_Target.js with the content of NGX_LPC4330_Xplorer_Target.js (the later pulls the former)
6.- Add some code to blink one of the board's leds and... Voila!
Examining the mcu registers (program counter) and disassembly windows I can see that the program is running in the 0x14000xxx memory range which correspond to SPIFI range on the LPC43xx MCU family... so I assume that the binary was flashed to the external spifi memory!Unfortunately this is not case because after I power-cycle the board the led work blink anymore... in fact the board seem to be dead!
To be sure I created another project using the "NGX LPC4330 Xplorer" template, added the code to blink the led and got same behavior... it works while debugging but stop working when the board is powered on in normal mode (No DFU and no debug adapter)
I also used the "Verify Elf File..." option to check the content of SPIFI memory and got the message "Verifier has found no errors" with both projects.
Regards
Please sign in to leave a comment.
Comments
5 comments