Hi,
I am using the imx rt 1020 EVK board. I can run the NOR FLASH SDK example without issues.
When I try to integrate the NOR FLASH SDK example in my own C++ project, I keep running into weird issues. Bus errors, Imprecise data bus errors, null pointer exceptions in the Flex SPI interrupt handler.
I created a new fresh new imx rt 1020 EVK C++ project, and started to integrate the SDK example. With minimal changes applied, I can reproduce the problem in my small C++ project.
The steps I took:
- New project, choose evk 1020, C++
- in Drivers selection add, choose cache, flexspi
- in Abstraction Layer, choose nor_flash-common, nor_flash-controller-flexpi
- Click finish, generate the project.
In the newly generated C++ project, I added the initialization code
Nor_Flash_Initialization(&norConfig, &norHandle);
(and I also added the initialization of config and handle).
The problem occurs when this function gets executed:
I added the complete project to this post as zip.
I am completely blocked by this, I have no clue what to do.
Some help/tips would be greatly appreciated!
Solved! Go to Solution.
Hi @bp1979
The SDK project already copy the related files to the internal RAM, do you do it?
You can the debug result, the API in the internal RAM:
Wish it helps you!
Best Regards,
Kerry
Hi @bp1979
I smiply checked your code, why you do the Nor_flash_initalization in the app code?
Do you try the sample one, no flash operation, just do the printf or the led_blinky, whether that method C++ project works or not?
Let me tell you, your code is running in the external flash, as you know, the external QSPI flash is not the RWW chip, so you can't run the code, and do the flash operation at the same time.
If you need to do the external flash operation, you need to copy the code to the internal RAM intead of running in the external flash.
So, your issues should not be caused by the C++, just your functions, you can test the simple project at first, whehter that works or not?
Best Regards,
kerry
Hi @kerryzhou
Thanks for taking the time to look at my project!
The simple blink / printf stuff will work (haven't tried, but I already have an entire application running on my board). I am trying to start making my bootloader, hence I need to be able to write my downloaded firmware.bin to some portion in flash.
You state:
Let me tell you, your code is running in the external flash, as you know, the external QSPI flash is not the RWW chip, so you can't run the code, and do the flash operation at the same time.
Can you then please explain why this works fine in the SDK example?
Screenshot of code in flash_component_nor SDK example:
Why is the SDK example not suffering from the fact that external flash is not RWW? What am I still missing here?
Many thanks!
Hi @bp1979
The SDK project already copy the related files to the internal RAM, do you do it?
You can the debug result, the API in the internal RAM:
Wish it helps you!
Best Regards,
Kerry
Ahaaa so that explains everything! No I haven't done that. I also didn't pay attention to the linker file template things in the SDK example.
One question about that if I may:
how does the linker file generation works? Will it magically pick up any file in my workspace with extension ".ldt" and use it as a template to generate the linker files?
I can see these three in the SDK example
but I can't find where they are "used" / referred.
I fixed it, still don't know how the linker file generation works, but when I simply copy the template files into my project, and change the names to the corresponding object files, it works.
Many thanks for your help and pointers!