ROBOTIS-GIT / OpenCR

Software for ROS Embedded board (a.k.a. OpenCR). OpenCR means Open-source Control Module for ROS.
Apache License 2.0
383 stars 238 forks source link

OpenCR 1.0 firmware upload is failed because of flash erase timeout #311

Open chjej202 opened 2 years ago

chjej202 commented 2 years ago

Hello,

I got an error during uploading my firmware on OpenCR 1.0 board.

The error message is shown in the following screenshot. capture

I noticed that the error is happened during flash erase, and I found that the timeout is happened because flash erase time took more than 3 seconds.

https://github.com/ROBOTIS-GIT/OpenCR/blob/c37bc731ffb84693f5742dd692d36656fffef72f/arduino/opencr_develop/opencr_ld/opencr_ld.c#L725

For this reason, I changed the above code from 3000 to 5000 to increase the timeout value. After I build and replace opencr_ld command, it works fine for me.

I think 3 seconds is too short to upload large firmware, so please increase the timeout value.

ROBOTIS-Will commented 2 years ago

Hi @chjej202

Thank you for reporting the issue. The timeout error during the flash upload is unusual as we test the upload procedure with provided firmware. Could you give us more information about your development environment? Assuming from the size of the 517KB binary file, are you uploading a customized firmware?

chjej202 commented 2 years ago

The timeout is happened when the binary file is very large. In my environment, it took around 3 seconds for uploading 500KB-size binary file. (510KB - flash upload ok (flash erase time: 2.9xx seconds), 512KB - flash erase timeout happened) I think that flash erase took several seconds to erase several hundreds of kilobytes.

Because of this issue, I cannot fully use all the flash memory provided by OpenCR 1.0 (768KB) unless the timeout value is not changed.

Our binary file includes lots of memory-burden examples. It includes arduino tensorflow lite for person detection, jpeg decoder, arduino cam, and code for accessing sensors and motors.

ROBOTIS-Will commented 2 years ago

@chjej202

Thanks for the details and how interesting that you are running the tensorflow on OpenCR!

Quite long ago, I uploaded the OV7725 + TFT OpenCR example, but wasn't able to expand to the proper image processing or machine learning.

If your project can be disclosed to the public via OpenCR eManual, it'd be an amazing OpenCR tensorflow example.

chjej202 commented 2 years ago

I uploaded my code related to use Arduino tensorflow lite on OpenCR 1.0.

I only changed and tested a person detection example only, but I think you can easily modify and run other examples also. You can check the commit logs to find which parts are modified.

Modified code to run ArduCAM library on OpenCR 1.0 board: https://github.com/chjej202/Arduino Modified code to run Arduino Tensorflow lite library on OpenCR 1.0 board: https://github.com/chjej202/Arduino_TensorFlowLite

Arduino tensorflow lite code was modified based on the code uploaded in https://www.arduino.cc/reference/en/libraries/arduino_tensorflowlite

ROBOTIS-Will commented 2 years ago

@chjej202 Super!!! Thanks for sharing your repos. We'll try them and share with developers through eManual and OpenCR examples. Have a great weekend ahead.