Is it possible to put Firmware loader into the Bootloader?

Moderators: odroid, mdrjr

Is it possible to put Firmware loader into the Bootloader?

Unread postby SarahC » Thu Oct 04, 2018 1:28 pm

Hi! I'm a 40's year old financial software developer with a passion for electronics and micro-control-units, and I wanted to share my experience and thoughts on a little part of developing code for the Go.

Getting back to the game emulator program.

Anyone that has used the Arduino dev exercises, and wanted to go back to the Go-Play emulator has probably had a little panic like I did just now.

You can't easily get back to the emulator unless you have visited the ONE page that contains the links to the three binaries, and flashing tool!

I found this out after a good look around:
The Arduino tools don't have a "Flash the Go-Play back to your Go!".
Powering on while holding the B button doesn't run the firmware flashing tool - this was unexpected! It was at this point I worried about how long it was going to be to get the Go-Play firmware back installed.

Was there a file I could upload directly?
I checked the "Burn bootloader" in Arduino for the Go board selected - nope.

The ESP32 device doesn't appear as a folder in Windows - so dragging the firmware into a "firmware" folder was out.

After reading the weather-station page about weather.fw file - it was called "firmware.fw". I thought "That's it! If the firmware flashing tool on the Go has been written over, it'll look on the SD card for 'firmware.fw' and flash it, yay!"
https://wiki.odroid.com/odroid_go/ardui ... nto_the_fw

But no - my Arduino program appeared when I turned it back on/back on with B/... and so on.

After much more searching for "writing go-play.fw to odroid" and a lot of other searches, I found the much needed page linked to here:
viewtopic.php?f=160&t=32359&p=234968#p234968

Which linked to the instructions here:
https://wiki.odroid.com/odroid_go/firmware_update

Wow!

To put it back in game-emulator state, I had to erase, then had to select the three files, enter their addresses in firmware, and upload to the Go.

It worked great, but the firmware was older than current and my game saves wouldn't continue - so I used the "On and B" to go to the firmware flashing utility on the Go, and used that to flash the go-play.fw I dropped in earlier.

Back to normal!

So to get to the most latest firmware after developing I have to:

1: Re-flash the older go-play firmware using the ESP32 flashing tool, after entering the three paths, and memory locations.
2: Put the latest firmware file on the SD card in Windows. (can be done just the once)
3: Put the Odroid Go in firmware flashing mode with "On and B".
4: Select the go-play firmware from the list (that contains python too!).

So after playing with code, I have to go through that sequence.

We really need a "back to game emulator" feature somewhere - that involves a button click, which will burn the SD card's firmware.fw (and the two other bits of BIN data the flasher burns) to the Go.

(I notice Linux has the "flashall.sh" command file in the firmware folder for go-play - which is a lot like a single "return to emulator" mode, even though it'll be for the old version.
I couldn't find command lines for the Windows tool ESPFlashDownloadTool_v3.6.4.exe that would do the same. =( )


Is this possible? Too much code in too little space?

I wonder - a flashing tool on the SD card - that writes the 3 binary images that way the bootloader just needs to grab SD card data.
Last edited by SarahC on Sat Oct 06, 2018 2:50 am, edited 1 time in total.
User avatar
SarahC
 
Posts: 19
Joined: Thu Oct 04, 2018 1:00 pm
languages_spoken: english
ODROIDs: Go

Re: Is it possible to put Firmware loader into the Bootloade

Unread postby crashoverride » Thu Oct 04, 2018 4:15 pm

The Arduino IDE (and all ESP32 tools) assume complete "ownership" of the development target. They overwrite any firmware that exists on a target device. Therefore, it is necessary to re-flash the odroid-go-firmware after using them. There is nothing that can be added to the bootloader or firmware to change this since Arduino will simply erase and overwrite it.
crashoverride
 
Posts: 4137
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Is it possible to put Firmware loader into the Bootloade

Unread postby deecee » Thu Oct 04, 2018 8:51 pm

SarahC wrote:So to get to the most latest firmware after developing I have to:
1: Re-flash the older go-play firmware using the ESP32 flashing tool, after entering the three paths, and memory locations.
2: Put the latest firmware file on the SD card in Windows. (can be done just the once)
3: Put the Odroid Go in firmware flashing mode with "On and B".
4: Select the go-play firmware from the list (that contains python too!).

You could also make an Arduino app for the Odroid Go using the 'mkfw'-tool, see:
https://wiki.odroid.com/odroid_go/arduino_app
Copy the .fw-file containing your program/application into the firmware folder of the SD card. If everything worked out fine you should be able to choose and run it after switching on the Odroid G while pressing the B button. This way you don't need to flash the firmware each time you run an Arduino application.

This solution has pros and cons:
pro:
- no need to flash the firmware after running an Arduino app - just switch on the Odroid Go while pressing the B button and choose a different 'firmware' (resp. application).
cons:
- needs some more 'fiddling around' with files: 'mkfw'-tool has to be used, file has to be copied to SD card, SD card has to be inserted into the O. Go, and so on.

Still, I am quite satisfied because I don't need to flash the firmware each time I run an application.
deecee
 
Posts: 17
Joined: Fri Aug 17, 2018 7:17 pm
languages_spoken: english
ODROIDs: Odroid go

Re: Is it possible to put Firmware loader into the Bootloade

Unread postby SarahC » Sat Oct 06, 2018 2:51 am

Thank you both for the explanations, and alternative ideas - I'll be using them. =)
User avatar
SarahC
 
Posts: 19
Joined: Thu Oct 04, 2018 1:00 pm
languages_spoken: english
ODROIDs: Go


Return to Arduino Coding Camp

Who is online

Users browsing this forum: No registered users and 13 guests