tago

How to check an uploaded hex file?

11 posts in this topic

Hi all,

i compiled my first app (MBNG v1) via make command and successfully uploaded the project.hex file to my STM32F4.

For testing purposes i changed MIOS32_LCD_BOOT_MSG_LINE1  (mios32_config.h) and some other SCS related vars, but i can't see these changes on the device (display).

Maybe i missing some steps? Is it enough to replace the project.hex file? Do i have to run the release.sh script?

Thank you


 

Edited by tago

Share this post


Link to post
Share on other sites

Generally you would just need to upload the new hex to the core and it should display the changed text when it boots. I've never known what the release.sh is for, I assumed it was for IDE use. Have you uploaded the pre-compiled hex to make sure the defaults works? I'm not sure about NG, do you have an SD card attached? It may be hanging without a card, but I don't know for sure.

Yogi

Share this post


Link to post
Share on other sites

Thanks @yogi

Yes, previously i had the precompiled NG on the core and everything worked as expected. A SD card is attached and working too.

It looks like the old hex file is still there on the core.

Maybe i edited the wrong config in trunk\apps\controllers\midibox_ng_v1\src\mios32_config.h?

Share this post


Link to post
Share on other sites

OK, so that kind of leaves the changes you made. mios32_config.h is where the boot string is defined, it gets displayed till the app changes the output to the LCD. Not familiar with NG and when it rewrites the LCD.

 What I usually do is make a copy of a project and place it in a new folder in my MIOS32 directory, alongside the trunk folder. This way I have the original code in 'trunk' and my changed code in the other folder. From then on, I run Make in the edit folder and this produces the new hex in this folder. From MIOS Studio I then upload this hex. I haven't worked on the NG scr but the process has worked well for what I have been working on.

Check that MIOS Studio is pointing to your build. If that is correct then review the changes you made and try only the boot string for a start. The only other thing I can think of is on a few occasions I have made changes to a scr file and run Make, BUT forgot to save my scr changes back to disk. Of course Make built a hex but based on the old scr!  So ' Edit, Save and then Make'. I'm using Notepad++ with the 'NppExe' plugin.

Yogi

Share this post


Link to post
Share on other sites

Thank you yogi. I did a copy of NG too and edited the code there.

Meanwhile i found the very stupid problem. I simply did not save the mios32_config.h file. I used sublime text to edit the files and there was no auto saving enabled.

Sorry!

Share this post


Link to post
Share on other sites

:)

Since i have no idea how to debug my code and no experience in C coding, should i get a proper IDE? How do you trace vars with a text editor and the compiler only? Do you only look at the compiler output during compilation?

Edited by tago

Share this post


Link to post
Share on other sites

I can't say that Notepad++ is the best way to work on projects; and if you want to dive into a proper IDE, Eclipse would be my first choice. In Npp you can trace a var to a point, you just have to setup the search. Eclipse would help with organizing your project and auto completion is handy, so getting to know it can speed your coding but it's not going to tell you if your logic is wrong. For this you would need a simulator or ICE tool so you can step through code and see the effect on memory or registers. I think STM does have tools but never looked. I'm a "code; compile; crash; repeat" guy :)

Yogi

Share this post


Link to post
Share on other sites

i'd recommand Code::Blocks , Cross-Platform and Easy to interface with any compilers

Share this post


Link to post
Share on other sites

I use IntelliJ a lot at work these days, as I *gasp* turned out to be an occasional Java hacker. It turns out that JetBrains has a similar IDE for C/C++ out - https://www.jetbrains.com/clion/ and it looks promising so far.

Edited by jojjelito

Share this post


Link to post
Share on other sites

IntelliJ IDEA is a good IDE, but for CLION unfortunately there isn't a free community edition. I'd like to try Visual Studio but it takes too (for me) much disk space to install.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now