prickle / Mavpixel

Mavpixel firmware repository
32 stars 12 forks source link

I cannot sucessfully flash Mavpixel firmware. #10

Open CarlouT opened 1 year ago

CarlouT commented 1 year ago

I downloaded Mavpixel firmware from Github (Filename: Mavpixel-master.zip) but when I flash it using MavpixelGUI, I get a successful flashing message at the end but the logs says 0 bytes of flash was written. Investigating the logs further shows that there was a warning that there is no end of file found for Intel Hex file "Mavpixel-master.zip". Can somebody have a look at this issue and probably offer a fix?

Flasher error

CarlouT commented 1 year ago

The way I tested if the flashing is successful is:

  1. Connected the MAVPIXL via the FTDI Programmer
  2. Entered the port number of the FTDI programmer and selected BAUD=57600
  3. Hit connect.

MavpixelGUI returned an error saying that Mavpixel not responding as shown below. NotResponding

prickle commented 1 year ago

Hi! Did you try unzipping the hex file before trying to flash it? Should solve the issue.

I don't think AVRDude knows how to handle zip files directly. Funny how it tries anyway and throws no errors, the flasher interprets that to mean it worked. Clearly it didn't! AVRDude was not easy to automate and still throws up edge cases like this. Most unhelpful!

Thanks for the report! Very detailed. I guess most people must use the automatic downloader ((*) Available Versions) rather than manually downloading as to why this has not been reported previously. The automatic downloader fetches the firmware hex file directly rather than the version github helpfully zips up for you if you click the download link.

Never mind, it's easy to get the hex file out of the zip and just flash that instead. Or even easier to select the latest version from the available versions dropdown and let the flasher do all the work!

Cheers!

prickle commented 1 year ago

Oh, I just spotted the error near the top of the AVRdude report above, "could not create SSL/TLS channel". Whoopsie!

So the automatic downloader is not working? This is an issue I will need to investigate!

CarlouT commented 1 year ago

Hi, I extracted the ZIP file and found a lot of files but there are two hex files namely:

  1. jD_IOBoard_MAVLink.04a.hex
  2. jD_IOBoard_MAVLink.05.hex

I thought the latest is the one with 05 so I used it to flash. It went well as shown in the screenshot below but I did not see the 1Hz pulse on the LED of Arduino. 1

So I tried to flash the one with 04 and this time the LED is flashing. 2

https://www.youtube.com/shorts/_EmwCT_RanI

But when I try to connect Mavpixel using the FTDI cable as shown, Mavpixel is not responding 3

Did I flashed the board with the correct firmware? And the remainign files in the ZIP file, do I need them? How will I use them? Do I need to install those files in order for Mavpixel to respond?

Thanks a lot for yourr help.

Regards, Carlou

prickle commented 1 year ago

Hi! I have updated MavpixelGUI to use TLS1.2 for security. This should fix the automatic downloader, update checking and other network connectivity issues. I have also modernised some other aspects and it should look a lot better in Windows 10.

Please uninstall the old version from Windows "Add/remove programs" - then download and install the new version of the GUI (1.4) from here and give the flasher a try for me. The latest version of the firmware is "Mavpixel v2.1 beta".

Cheers!

CarlouT commented 1 year ago

Hi,

Thanks for fixing the connectivity issue. It is now working. I should say you've done an enormous work on this tool. The Arduino code is very nice. Unfortunatly, I think the libraires from GITHUB has to be updated as the code ends up in an error if you try to upload the ino file using Arduino IDE. But for ordinary users who do not want to see what is happening under the hood, the new firmware is good enough. The new libraries is nice to have.

Again thanks a lot for your help.

Regards, Carlou

prickle commented 1 year ago

Thanks! Glad it's working. Most of the code is other people's, I simply stiched it together.

The code is very tight, as in it almost completely filled flash memory, making it difficult to compile properly. Recent versions of Arduino with the updated complier and newer C libraries probably produce larger code that will no longer fit in memory. Compiling with an earlier version of Arduino is probably necessary. I'm not sure which, it's been a while since I built this project and I don't have a dev environment set up. It may be mentioned in the comments somewhere. Never mind, the latest built version seems pretty stable.

Cheers!