Skip to content
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

Save/load presets to USB disk & tool for exporting 1.6.1 hexdump to JSON file #44

Merged
merged 34 commits into from Jun 3, 2019

Conversation

@csboling
Copy link
Contributor

@csboling csboling commented May 21, 2019

Fixes #7 🎉

Latest build is here. UI is as described in the Lines topic, with the addition that an error during read will turn both status LEDs on until you press the mode button or remove the USB disk.

The tools/flash_tools folder includes some Python code which is useful for interacting with firmware images. This could perhaps be split off to another repo, but the most useful functionality there currently is producing a JSON preset backup file from a backed-up firmware image from a previous Ansible version:

dfu-programmer at32uc3b0512 read > ansible-backup.hex
python main.py ansible extract --version 1.6.1 ansible-backup.hex --out ansible-preset.json

Currently only 1.6.1 and 1.6.1-es (latest ansible + earthsea) are available. Older firmware releases can be added easily enough by pulling together the nvram struct definitions from a couple header files. More info in the tools/flash_tools/README.md.

Memory usage before:

   text    data     bss     dec     hex filename
0x15622   0x654 0x3b4cc  332098   51142 ansible.elf

After:

   text    data     bss     dec     hex filename
0x1a482  0x18a4 0x3a278  352158   55f9e ansible.elf

I can do some more detailed symbol dump investigation to try and find the worst offenders in the data section if necessary but I'm guessing a lot of it is preset_docdef_t storage. Interestingly bss got quite a bit smaller -- disregarding the text section it looks like this only uses 4 extra bytes of data.

@tehn tehn requested a review from scanner-darkly May 23, 2019
@tehn
tehn approved these changes May 23, 2019
Copy link
Member

@tehn tehn left a comment

monumental effort!

this looks good to me just reading through. i won't have a chance to test on hardware for a while--- but hopefully there are some beta volunteers on the forum?

thank you!!

@tehn
Copy link
Member

@tehn tehn commented Jun 3, 2019

i feel this is good to merge. any concerns @scanner-darkly ?

@scanner-darkly
Copy link
Member

@scanner-darkly scanner-darkly commented Jun 3, 2019

no concerns but not sure what this means for ansible earthsea and unfortunately i don't have the bandwidth to test. @csboling if you could try building it with ansible earthsea branch as you mentioned on lines this would be hugely helpful! if it doesn't work and there is no easy fix then i'd say let's leave ansible earthsea as a custom firmware that only works with pre-presets ansible.

@tehn tehn merged commit 9ee852a into monome:master Jun 3, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants