Git Product home page Git Product logo

Comments (2)

btsimonh avatar btsimonh commented on July 17, 2024

Reason I found it was that I'd swapped use of #ifdef FLASH_CONTENT (which is a structure) for FLASH_STORAGE (which is the actual controlling define?) in main, but not both entries, and initflash was not called.
This lead to the flash not being intialised, and so the data being empty every start - and that lead me to investigate flash. I found the non-inialisation fault, but then found that the flash values did not survive reboot.

I enabled 'DEBUG_SOFTWARE_SERIAL' which enables console logs after 'Ec\n' on ascii....
The flash writer was running, and incrementing the pointer, and the address was in the 0x8000xxxx range...

but this warning could be the key:
'Warning! Cannot find a linker script for the required board! Firmware will be linked with a default linker script!'
(but; is this just a generic warning - we specify linker script in command line arguments in platformio.ini?)

the flash code relies on the data begin in a special segment ('.myFlashSection') which must be 2048 aligned, (and beyond the end of code?).

It works like this:
An area the size of one erase block is created outside of the code area, filled with 0xff in the initial flash image. (is there some way this is made to be not present in the image?)
If the flash magic is not at the start, it's erased and initialised.
When reading, the flash read looks for the END of used data, and so reads the most recently written. Only if a new block will not fit is an erase operation done, and the data starts to be written from the start again.
Flash values are kept in RAM after read. When writing a flash variable, it is written to RAM.
only by using 'Fm1234\n' in ascii can the RAM be written to flash..

I'll try to load the old firmware and see if that worked..... If i get a chance.

from bipropellant-hoverboard-firmware.

btsimonh avatar btsimonh commented on July 17, 2024

I just did a few commits; nothing I think i changed should have changed anything, but flash IS working. So not quite understanding what was wrong; probably just me. Anyway, new commits add memory dump and flash dump to ascii

from bipropellant-hoverboard-firmware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.