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

Update to fix flash and other related bugs #11

Merged
merged 8 commits into from
May 21, 2019

Conversation

lalalandrus
Copy link
Contributor

As per issue 10 comments

reserve flash storage section
previous linker declaration didnt work with current version of platformIO
!defined(READ_SENSOR) was missing cause resource conflict
software serial must be initalized prior to flash init for debug message
update the flash storage location as per the linker script
fix .isr_vector typo
@p-h-a-i-l
Copy link
Member

see #10

@p-h-a-i-l p-h-a-i-l requested a review from btsimonh May 19, 2019 10:54
@btsimonh
Copy link
Contributor

looks good to me without building and testing.
Qs:
1/ does myFlashSection (RESERVED_FLASH) exist in the flashable image? (we don't really want it to...)
2/ would it be better to, instead of
volatile uint8_t *flash_data = (uint8_t *) 0x08000000 + 0x40000 - 0x800;
use .myFlashSection -
or would this force it to be inside the flashable image?

@lalalandrus
Copy link
Contributor Author

lalalandrus commented May 19, 2019

  1. the way the ld is set so that there is that I will exist in the flash image if this is undesirable i think you can remove keep from the mysection in the linker script and include flasharea.c through a define only if you want to format the flash. This way the petitions still exist so there is no chance of conflicr but it won't be in the firmware file either.

  2. you can use any region you want. We should have both the linker and flash access use the same defines. If you use a region in the middle I don't see any benefit at the moment as it reserves a chunk in the middle of the flash which could cause future issues. You can grow sections from either side and work towards the middle this way. Tail end for storage and head end for code space.

@btsimonh
Copy link
Contributor

yep, see if you can remove it from the flash image. The flash should initialise if the magic is not valid, but I moved from an area inside the flash image to one outside to try to keep existing flash values through firmware updates. We can scrap 'flasharea.c' completely - I don't see it as relevant any more?

@lalalandrus
Copy link
Contributor Author

You could change #if def Flash_storage to soemthinglike flash_init and keep the file for formatting the flash. Don't know if anyone sees value in this.

@btsimonh
Copy link
Contributor

you can always init the flash via serial.... (if it does not detect that it needs to init because magic is wrong)?

@lalalandrus
Copy link
Contributor Author

lalalandrus commented May 19, 2019

yes i just confimred it works. remove flasharea.c and remove the keep before the .mysections. in the future you can use someting like flasharea.c to define some initial good settings

@btsimonh
Copy link
Contributor

great - add the commit, and i'll see if i can test tonight.

@btsimonh
Copy link
Contributor

haha... built 'env hoverboard'; did not notice the firmware.bin was 256k, ran my flash.sh, and it failed.
Now I'll have to hold my power button until the Rpizero has booted, and operate all the logging in and flashing with the other hand! serves me right for not being vigilent....

@lalalandrus
Copy link
Contributor Author

lalalandrus commented May 21, 2019

Make sure you change the ld file too. I fried my St link so we both had some setbacks.

@btsimonh
Copy link
Contributor

just flashed back to @p-h-a-i-l 's 'size' stuff and it's back. will try build again.

@btsimonh
Copy link
Contributor

are you building the hoverboard env in pio?

@btsimonh
Copy link
Contributor

ahh... did you not push the remove of keep?

@lalalandrus
Copy link
Contributor Author

lalalandrus commented May 21, 2019

Miscommunication I thought you would add that commit. In fact i dont seem to know how to edit pull requests

@lalalandrus
Copy link
Contributor Author

oh i think it worked, if not the code is commited to my fork

@btsimonh
Copy link
Contributor

btsimonh commented May 21, 2019

ok, can confirm hoverboard operation with this combined with @p-h-a-i-l 's latest.
Now need to check protocol.
protocol seems ok :).
need to check flash....
flash write confirmed with 'fsl300\n', 'fm1234\n', reset, 'fa\n'.

@btsimonh btsimonh merged commit 488c71a into bipropellant:master May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants