2020-02-21 02:24 PM
Does anyone have a decent recipe for creating the ST-Link compatible driver for an SPI NOR device? Using the examples in STM32 ST-Link utility I have been able to create and debug the needed routines to intialize, erase, write, and read my flash in a stand-alone environment created by CubeMX. It has a main() that I just used to call and debug the SPI routines. I am really struggling with how to create the driver that will work with the ST-Link utility. My MCU is an STM32H7 device and the closest example code was for an F7 device. The very limited instructions say to just plunk their example code into the Projects director of your target device, and compile!
The practice, especially with changing MCU cores is yielding layes and layers of errors that involve somewhat blindly copying over driver/include/startup files from other H7-based projects. I'm sure I could work through eventually, but seems much harder and error prone than it should be. Does anyone have a recipe for how to create these drivers with more detail than the one line "it is easy to port to other MCUs" instructions that come with the example drivers? I can't find anything in official ST documentation with any more detail, and it seems strange I can't find anything with searches here.
My preferred toolchain is Atollic (or CubeIDE), but I also have IAR available too.
Thanks in advance.
will
2020-02-21 03:29 PM
Currently doing cook to order, in a private chef capacity..
2020-02-21 06:33 PM
I appreciate the offer clive1, but don't have a budget to pay for answers unfortunately.
As with other posts of mine, hoping for community guidance and once I figure it out (either with help or by myself), plan on posting the results for all.
I'm not objecting to your business model, it's just not mine.
will
2020-03-09 12:37 PM
Absent paying for a solution, I am making some progress after needing to take a break for a bit. My intent is still to write something up once I get it working.
Some important notes:
So, at least making progress, but temporarily stuck between an older compiler that generates good code but doesn't support my MCU and a newer compiler that supports my MCU, but has a compatibility issue with STM32CubeProgrammer. I will continue looking at both options, not sure which one is easier to resolve. Long term, clearly would prefer to be able to use newer tools for a more general purpose solution.
I'm taking good notes so that I should have a good recipe once I get things actually working.
will
2020-04-16 02:56 PM
All:
Good news! What I have isn't pretty, but I finally was able to get a working Loader file for my STM32H750! I've been documenting things as I go along, so just need t clean it up into something that makes a bit more sense.
I'm sure the process can be cleaned up a lot, but something that actually works is a good baseline from which to use as a baseline. Hopefully back in a few days.
Full disclosure: The time from my question to a solution was more a factor of me working on other stuff than the time needed to get the solution.
will
2020-04-19 02:22 PM
All:
Attached is my first draft of an App note describing how I got a working Loader file for my STM32H7 along with a zipped up working project. Of note, what made this difficult was there are no source examples for the H7 series, so just "adapting an existing example" meant swapping out a lot of libraries.
Also of note, I ran into the same issue others have reported about IAR8 not generating loaders that STM32CubeProgrammer is able to parse, so this working example is based on using IAR7.
Any feedback is appreciated, and if someone is able to port it to a current IDE (one of the free ones), I'd be happy to incorporate it into the example and update the App note. Absent feedback I'll do it too, but just not as fast. The loader is a means to and end, and since I have something at least working, going to go work on the "end" a bit before coming back to updating the loader.
Hope this helps and looking forward to any feedback, would be nice to have something collaborative out of this!
will
2020-04-19 02:23 PM