-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated elf2uf2 to allow more targets #1038
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very awesome!
I wonder how much work a |
Do you want to try to rebase your branch on top of the latest develop? While on your branch do |
I'm glad you approve! Been kinda busy today, but I took a closer look and made some changes in the sections where the data blocks are laid out and then assembled. I thought the nested dictionaries were a bit cumbersome, went with three-element tuples for the page fragments. I'm doing testing with examples now, looks good so far. I'll commit that change and then try the rebase. As far as a program-uf2 command is concerned, it shouldn't be too hard, but I would have to check into where the different systems mount the drives. Ubuntu is easy, I haven't touched a Windows box for years, and I've never had a Mac. |
Please forgive my inexperience with git. After doing the rebase, I couldn't push anything else to the branch. I merged it into develop on the local, and then pushed to develop on my remote. The branch is still there, but it's the unrebased version. |
No worries, I rebased and squashed your commits into two, will merge next. |
Thanks! So where did I go wrong? Should I have not done the merge of the branch into develop after the rebase? The branch looks just as it did before the rebase, and develop looks good to go, just 3 commits (the way that I squashed them) ahead. I like to submit things, but git can still make me feel like an idiot :-( Your comments, when you have time, are welcome. |
What you did worked, however, you rebased your local develop branch on top of the modm/develop branch and then pushed that to your fork. However, this PR only gets updated when you (force) push to its branch on your fork ( I personally use a mix of GUI and CLI for everyday git operations (only using CLI is just too annoying for most things), so in my maintainer view it looks like this:
You would have to do this from the other perspective, ie. add the |
Great! Thanks so much for the explanation! I didn't try to force the push; I see the failure message and think anything that says 'force' will just make matters worse (past experiences breaking things :-) This should be a great help. On to the next project! |
In my recent PR for the FeatherM4 board, I noted that the elf2uf2.py tool used by modm was written specifically for the RP2040. @salkinium questioned that, and I pointed out the reasons that was true.
I decided to see if I could change it, and hence this PR. I consider this to be a solution looking for a problem, since even though it will now produce a uf2 file for almost every ARM-based example, the number of boards with uf2 bootloaders in that list is limited to maybe half a dozen at most (and the RP2040 boards already worked).
One thing I found while working on this: only the memories listed in the device file are passed to the program. Those that are added or manipulated in the board module are not, and would cause an exception. Since these are usually RAM, nothing from the ELF file gets directly loaded to them; so if a memory range shows up in the ELF program header that was not an argument to elf2uf2, and the ph filesize parameter is zero, a message is printed and the conversion continues. (That seldom happens, and not at all with the boards that matter here.)
In looking at modm-generated makefiles, I found that the memory ranges for this command all started with '0x0x' instead of just '0x'. The source of that was in build_script_generator/make/module.lb, and has been fixed.
I also updated the FeatherM4 documentation to reflect the fact that the uf2 method will now work.
Thanks,
Tom Rush