Giter VIP home page Giter VIP logo

ota_update_avr_using_esp32's People

Contributors

laukik-hase avatar udit7395 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ota_update_avr_using_esp32's Issues

Extended Addresses not supported

Either Hex parser or flashing does not seem to support extended addresses. Failed e.g. with hex file having section:

:10FF60008B819C8101969C838B838BAD9CADADADC9
:10FF7000BEADBC01CD010E9458DD9C018B819C81EE
:10FF800082179307A8F240E061E080E00E94EDC490
:10FF900080E00E9444C48EE796E120E040E0BC018E
:10FFA00080E00E94E5C18A818F9389818F9383E2EB
:10FFB00095E0892F8F9383E295E08F93CE01489649
:10FFC000292F2F938F930F94082E0F900F900F903F
:10FFD0000F900F900F90CE01489620E040E050E047
:10FFE000BC0180E00E9457C24CE856E1CE01CF969A
:10FFF000FC01208131818BAD9CADADADBEADBC01AE
:020000021000EC
:10000000CD010E9459B68A818F9389818F9383E2B3
:1000100095E0892F8F9383E295E08F93CE014896E8
:10002000292F2F938F930F94082E0F900F900F90DE
:100030000F900F900F90CE01CF96FC01208131815F
:10004000AE01485E5F4F8BAD9CADADADBEADBC01AA
:10005000CD010E94E2B541E956E1CE01CF96FC0107
:10006000208131818BAD9CADADADBEADBC01CD016C
:100070000E9459B61D8240C08BAD9CADADADBEADEA
:10008000BC01CD010E9458DD8F709927892BC9F1E1
:100090008BAD9CADADADBEADBC01CD010E9458DDB8
:1000A000998B888B888999899C0140E050E08BADC1

hexparser gives invalid page data

Debugging this for atmega2560

Got invalid page data, had to change hex_parser.c
from

        if (strlen(buff) > 12)
        {
            int start = 9;
            int end = strlen(buff) - 4;
            int size = (end - start) + 1;

to

        if (strlen(buff) > 12)
        {
            int start = 9;
            int end = strlen(buff) - 2;
            int size = (end - start) + 1;

When using hex file starting

:020000040000FA
:100000000C9417010C942B010C942B010C942B01D4
:100010000C942B010C942B010C942B010C942B01B0
:100020000C942B010C942B010C942B010C942B01A0

waitForSerialData timeout

Noticed time out in waitForSerialData seems not to work as expected. In case MAX_DELAY_MS is intended to be 1000ms, function has 250ms for timer, so timeout is multiplied by 250x.

 int sendBytes(char *bytes, int count)
{
    sendData(TAG_AVR_PRO, bytes, count);
    int length = waitForSerialData(MIN_DELAY_MS, MAX_DELAY_MS);

    if (length > 0)
    {
   
int waitForSerialData(int dataCount, int timeout)
{
    int timer = 0;
    int length = 0;
    while (timer < timeout)
    {
        uart_get_buffered_data_len(UART_NUM_1, (size_t *)&length);
        if (length >= dataCount)
        {
            return length;
        }
        vTaskDelay(250 / portTICK_PERIOD_MS);
        timer++;
    }
    return 0;
}

Mistype in adr_hi and adr_lo

Hello.
In function loadAddress() (master/components/avr_flash/avr_flash.c, line 16) looks like mistype in names of parameters. According to STK500 protocol description (http://www.amelek.gda.pl/avr/uisp/doc2525.pdf) after command ("0x55") first you should provide low address, then high address. So, total sequence should be "0x55, lo, hi".
In function flashPage(), which calls loadAddress(), we are providing parameters also in incorrect order: address[1] is actually low part of address, but address[0] - high. Look at incrementLoadAddress() - first you increase loadAddress[1] and only after it overflows, you increase loadAddress[0].
So, one bug neutralized another. To write this code in proper way, we should swap parameters at lines 53 and 18.

It is just assumption, because I'm quite new in this protocol. Even if this is correct, it is more cosmetic change. Could you pleaes confirm that this assumption is correct? Or I'm mistaken?

ESP32s2 - error at flashing - FAILED:CMakeFiles/flash .

Greetings,

I'm trying to flash the ESP32s2 with this software. It doesn't work but I guess that flashing doesn't actually finish completly.

Here's what's in the console(Using ESP-IDF)

` [2/3] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v4.4.4\components\esptool_py && C:\Espressif\tools\cmake\3.23..._ESP32/file_serving_avr/build" -P C:/Espressif/frameworks/esp-idf-v4.4.4/components/esptool_py/run_serial_tool.cmake"
esptool.py esp32s2 -p COM15 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 file_server_avr.bin 0x8000 partition_table/partition-table.bin
esptool.py v3.3.2
Serial port COM15
Connecting....
Chip is ESP32-S2FH4
Features: WiFi, Embedded Flash 4MB, No Embedded PSRAM, ADC and temperature sensor calibration in BLK2 of efuse V1
Crystal is 40MHz
MAC: 84:f7:03:db:76:36
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00010000 to 0x000bdfff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 20752 bytes to 12998...
Writing at 0x00001000... (14 %)
Writing at 0x00002432... (28 %)
Writing at 0x00003110... (42 %)
Writing at 0x00003c91... (57 %)
Writing at 0x000046e3... (71 %)
Writing at 0x00005079... (85 %)
Writing at 0x00005d13... (100 %)
Wrote 20752 bytes (12998 compressed) at 0x00001000 in 0.4 seconds (effective 471.6 kbit/s)...
Hash of data verified.
Compressed 710768 bytes to 454405...
Writing at 0x00010000... (0 %)
Writing at 0x000115aa... (0 %)
Writing at 0x00012c59... (1 %)
Writing at 0x00014101... (1 %)
Writing at 0x0001599d... (2 %)
Writing at 0x00016da2... (2 %)
Writing at 0x00018593... (3 %)
Writing at 0x00018d09... (3 %)
Writing at 0x00019467... (4 %)
Writing at 0x00019bc0... (4 %)
Writing at 0x0001af72... (4 %)
Writing at 0x0001c8ca... (5 %)
Writing at 0x0001e130... (5 %)
Writing at 0x0001fa8e... (6 %)
Writing at 0x00021689... (6 %)
Writing at 0x000230a7... (7 %)
Writing at 0x0002486e... (7 %)
Writing at 0x0002608c... (8 %)
Writing at 0x000274dc... (8 %)
Writing at 0x0002804e... (9 %)
Writing at 0x000294de... (9 %)
Writing at 0x0002b515... (9 %)
Writing at 0x0002c964... (10 %)
Writing at 0x0002da89... (10 %)
Writing at 0x0002e675... (11 %)
Writing at 0x0002f104... (11 %)
Writing at 0x0002fd55... (12 %)
Writing at 0x00030a2c... (12 %)
Writing at 0x000317b1... (13 %)
Writing at 0x0003250f... (13 %)
Writing at 0x00032f86... (13 %)
Writing at 0x00033a7a... (14 %)
Writing at 0x0003463a... (14 %)
Writing at 0x000351e2... (15 %)
Writing at 0x00035c56... (15 %)
Writing at 0x000366d5... (16 %)
Writing at 0x00037288... (16 %)
Writing at 0x00037d24... (17 %)
Writing at 0x00038821... (17 %)
Writing at 0x00039256... (18 %)
Writing at 0x00039d6b... (18 %)
Writing at 0x0003a8a3... (18 %)
Writing at 0x0003b40f... (19 %)
Writing at 0x0003bf2a... (19 %)
Writing at 0x0003c940... (20 %)
Writing at 0x0003d426... (20 %)
Writing at 0x0003dee3... (21 %)
Writing at 0x0003e932... (21 %)
Writing at 0x0003f686... (22 %)
Writing at 0x00040407... (22 %)
Writing at 0x00040f4b... (22 %)
Writing at 0x00041a4a... (23 %)
Writing at 0x00042513... (23 %)
Writing at 0x000431a0... (24 %)
Writing at 0x00043c81... (24 %)
Writing at 0x000447e4... (25 %)
Writing at 0x00045302... (25 %)
Writing at 0x00045d98... (26 %)
Writing at 0x00046a42... (26 %)
Writing at 0x0004757e... (27 %)
Writing at 0x00048157... (27 %)
Writing at 0x00048c0f... (27 %)
Writing at 0x00049813... (28 %)
Writing at 0x0004a456... (28 %)
Writing at 0x0004ae76... (29 %)
Writing at 0x0004b9d6... (29 %)
Writing at 0x0004c4fb... (30 %)
Writing at 0x0004cf55... (30 %)
Writing at 0x0004da27... (31 %)
Writing at 0x0004e588... (31 %)
Writing at 0x0004efda... (31 %)
Writing at 0x0004fafb... (32 %)
Writing at 0x0005050f... (32 %)
Writing at 0x0005100d... (33 %)
Writing at 0x00051b89... (33 %)
Writing at 0x000525a2... (34 %)
Writing at 0x00053171... (34 %)
Writing at 0x00053c1b... (35 %)
Writing at 0x0005486e... (35 %)
Writing at 0x000553a1... (36 %)
Writing at 0x00055e48... (36 %)
Writing at 0x00056893... (36 %)
Writing at 0x0005735a... (37 %)
Writing at 0x00057dd1... (37 %)
Writing at 0x00058865... (38 %)
Writing at 0x00059372... (38 %)
Writing at 0x00059f3c... (39 %)
Writing at 0x0005ab88... (39 %)
Writing at 0x0005b679... (40 %)
Writing at 0x0005c171... (40 %)
Writing at 0x0005cc96... (40 %)
Writing at 0x0005d727... (41 %)
Writing at 0x0005e234... (41 %)
Writing at 0x0005ecb8... (42 %)
Writing at 0x0005f831... (42 %)
Writing at 0x0006041d... (43 %)
Writing at 0x00060f86... (43 %)
Writing at 0x00061aca... (44 %)
Writing at 0x000625c0... (44 %)
Writing at 0x0006303e... (45 %)
Writing at 0x00063b48... (45 %)
Writing at 0x000647cd... (45 %)
Writing at 0x000652ef... (46 %)
Writing at 0x00065db7... (46 %)
Writing at 0x00066803... (47 %)
Writing at 0x00067173... (47 %)
Writing at 0x00067b08... (48 %)
Writing at 0x000684cd... (48 %)
Writing at 0x00068e2c... (49 %)
Writing at 0x000697bb... (49 %)
Writing at 0x0006a1ed... (50 %)
Writing at 0x0006ac1c... (50 %)
Writing at 0x0006b5f5... (50 %)
Writing at 0x0006bffe... (51 %)
Writing at 0x0006ca56... (51 %)
Writing at 0x0006d478... (52 %)
Writing at 0x0006df67... (52 %)
Writing at 0x0006e931... (53 %)
Writing at 0x0006f2f6... (53 %)
Writing at 0x0006fcb5... (54 %)
Writing at 0x00070666... (54 %)
Writing at 0x000710ac... (54 %)
Writing at 0x00071a9a... (55 %)
Writing at 0x0007245b... (55 %)
Writing at 0x00072e21... (56 %)
Writing at 0x000737ed... (56 %)
Writing at 0x00074325... (57 %)
Writing at 0x00074d42... (57 %)
Writing at 0x000757a8... (58 %)
Writing at 0x00076212... (58 %)
Writing at 0x00076ddc... (59 %)
Writing at 0x00077854... (59 %)
Writing at 0x0007829b... (59 %)
Writing at 0x00078cab... (60 %)
Writing at 0x000796ab... (60 %)
Writing at 0x0007a026... (61 %)
Writing at 0x0007aabb... (61 %)
Writing at 0x0007b64e... (62 %)
Writing at 0x0007c072... (62 %)
Writing at 0x0007cbe5... (63 %)
Writing at 0x0007d652... (63 %)
Writing at 0x0007e0fd... (63 %)
Writing at 0x0007ead8... (64 %)
Writing at 0x0007f5dc... (64 %)
Writing at 0x00080050... (65 %)
Writing at 0x00080a94... (65 %)
Writing at 0x00081744... (66 %)
Writing at 0x0008248c... (66 %)
Writing at 0x0008311a... (67 %)
Writing at 0x00083c3a... (67 %)
Writing at 0x000846fd... (68 %)
Writing at 0x000851b7... (68 %)
Writing at 0x00085bf6... (68 %)
Writing at 0x000866c8... (69 %)
Writing at 0x000871c5... (69 %)
Writing at 0x00087cf7... (70 %)
Writing at 0x00088895... (70 %)
Writing at 0x000893f2... (71 %)
Writing at 0x0008a054... (71 %)
Writing at 0x0008ab48... (72 %)
Writing at 0x0008b5a8... (72 %)
Writing at 0x0008c227... (72 %)
Writing at 0x0008ce81... (73 %)
Writing at 0x0008d93f... (73 %)
Writing at 0x0008e5cf... (74 %)
Writing at 0x0008f35d... (74 %)
Writing at 0x000900c0... (75 %)
Writing at 0x00090d10... (75 %)
Writing at 0x0009180d... (76 %)
Writing at 0x000924b5... (76 %)
Writing at 0x000932b3... (77 %)
Writing at 0x000946a8... (77 %)
Writing at 0x0009512b... (77 %)
Writing at 0x00095c42... (78 %)
Writing at 0x000965a4... (78 %)
Writing at 0x00097015... (79 %)
Writing at 0x00097bba... (79 %)
Writing at 0x00098622... (80 %)
Writing at 0x00099066... (80 %)
Writing at 0x00099b27... (81 %)
Writing at 0x0009a61d... (81 %)
Writing at 0x0009b1a2... (81 %)
Writing at 0x0009bc21... (82 %)
Writing at 0x0009c89c... (82 %)
Writing at 0x0009dd5b... (83 %)
Writing at 0x0009f014... (83 %)
Writing at 0x000a179d... (84 %)
Writing at 0x000a22d2... (84 %)
Writing at 0x000a2cbe... (85 %)
Writing at 0x000a3a78... (85 %)
Writing at 0x000a4cf2... (86 %)
Writing at 0x000a60d6... (86 %)
Writing at 0x000a8390... (86 %)
Writing at 0x000a901c... (87 %)
Writing at 0x000a9d05... (87 %)
Writing at 0x000aa83c... (88 %)
Writing at 0x000ab3cc... (88 %)
Writing at 0x000abfdc... (89 %)
Writing at 0x000aca2b... (89 %)
Writing at 0x000ad565... (90 %)
Writing at 0x000ae13a... (90 %)
Writing at 0x000aeda1... (90 %)
Writing at 0x000af9bc... (91 %)
Writing at 0x000b06bd... (91 %)
Writing at 0x000b11cb... (92 %)
Writing at 0x000b1c93... (92 %)
Writing at 0x000b278e... (93 %)
Writing at 0x000b32e4... (93 %)
Writing at 0x000b3eac... (94 %)
Writing at 0x000b4a16... (94 %)
Writing at 0x000b5a56... (95 %)
Writing at 0x000b66f5... (95 %)
Writing at 0x000b706b... (95 %)
Writing at 0x000b7a54... (96 %)
Writing at 0x000b83fc... (96 %)
Writing at 0x000b8e21... (97 %)
Writing at 0x000b982a... (97 %)
Writing at 0x000ba255... (98 %)
Writing at 0x000bacbb... (98 %)
Writing at 0x000bb6d1... (99 %)
Writing at 0x000bc08a... (99 %)
Writing at 0x000bcb5b... (100 %)
Wrote 710768 bytes (454405 compressed) at 0x00010000 in 8.3 seconds (effective 682.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 461.7 kbit/s)...
Hash of data verified.

Leaving...
WARNING: ESP32-S2FH4 chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
CMake Error at run_serial_tool.cmake:56 (message):
C:/Espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe
C:/Espressif/frameworks/esp-idf-v4.4.4/components/esptool_py/esptool/esptool.py
--chip esp32s2 failed

FAILED: CMakeFiles/flash C:/Users/Krzysztof/esp/OTA_update_AVR_using_ESP32/file_serving_avr/build/CMakeFiles/flash
cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v4.4.4\components\esptool_py && C:\Espressif\tools\cmake\3.23.1\bin\cmake.exe -D IDF_PATH="C:/Espressif/frameworks/esp-idf-v4.4.4" -D SERIAL_TOOL="C:/Espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/Espressif/frameworks/esp-idf-v4.4.4/components/esptool_py/esptool/esptool.py --chip esp32s2" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/Krzysztof/esp/OTA_update_AVR_using_ESP32/file_serving_avr/build" -P C:/Espressif/frameworks/esp-idf-v4.4.4/components/esptool_py/run_serial_tool.cmake"
ninja: build stopped: subcommand failed.
ninja failed with exit code 1 `

The ESP turns on and connect to wifi but when accessing to the webpage it shows:

Directory does not exist

Monitor is empty as esp32s2 can't have wifi and usb console at the same time - any thoughts?

Help Required in Programming Arduino UNO

The system works fine, and the code is being uploaded to the Arduino. However, when I try to upload new hex file the code does not run on the Arduino.

For example, I program the Arduino with 500ms of flashing an LED the led flashes, and upload the same hex file the Arduino functions properly but when I upload a Hex with 50ms flashing of an LED the code flashes properly but the led does not blink. Could you please help me set this up.

Arduino Mega OTA update issue

Hello @laukik-hase and @udit7395,

I found this resource very useful as I want to update my Arduino Mega through ESP32. I am glad that the code worked for Arduino Uno by making sure both the modules are powered separately and ensuring a Logic Level Converter between the two. However, I am facing issues interfacing with Arduino Mega. The new code gets written successfully to the Arduino Mega program memory but the readTask returns ESP_FAIL as the verification of the 1st block itself fails.

The screenshot describing the same is attached below.
Screenshot from 2022-06-20 16-44-46

I have a basic knowledge of how the code is uploaded through stk500 commands. But, I am not able to understand what exactly is the issue here. Are there any specific requirements or code changes that need to be done before updating Arduino Mega via ESP32?

Thanks in advance:)

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.