Giter Site home page Giter Site logo

Comments (5)

kzyapkov avatar kzyapkov commented on July 30, 2024

Haven't seen this before, but it may be caused by insufficient space on FailFS, or fragmentation thereof. Can you try formatting the flash first? Also, can you add logging so we can see which fragment of the upload fails? does it get anywhere?

Also, try flashing using some other tool: cc3200prog from Energia can upload mcuimg.bin, or see if Uniflash works.

from cc3200tool.

dhylands avatar dhylands commented on July 30, 2024

Here's some added logging on the one that fails. It's the _send_packet inside _open_file that's timing out.

+ cc3200tool -p /dev/ttyUSB1 --sop2 '~dtr' --reset prompt write_file target/thumbv7em-none-eabi/debug/sensorweb-firmware.bin /sys/mcuimg.bin
2016-12-01 23:49:58,104 -- Connecting to target...
Reset the device with SOP2 asserted and press Enter

2016-12-01 23:50:08,874 -- timed out while waiting for ack
2016-12-01 23:50:09,132 -- Connected, reading version...
2016-12-01 23:50:09,132 -- _send_packet len = 1
2016-12-01 23:50:09,134 -- connected to target
2016-12-01 23:50:09,134 -- Version: CC3x00VersionInfo((0, 4, 1, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-12-01 23:50:09,135 -- This is a CC3200 device
2016-12-01 23:50:09,135 -- Switching to NWP bootloader...
2016-12-01 23:50:09,135 -- _send_packet len = 1
2016-12-01 23:50:09,137 -- Switching UART to APPS...
2016-12-01 23:50:09,137 -- _send_packet len = 5
2016-12-01 23:50:09,139 -- Resetting communications ...
2016-12-01 23:50:10,396 -- _send_packet len = 1
2016-12-01 23:50:10,398 -- Uploading rbtl3100s.dll...
2016-12-01 23:50:10,400 -- Getting storage list...
2016-12-01 23:50:10,400 -- _send_packet len = 1
2016-12-01 23:50:10,402 -- Getting storage info...
2016-12-01 23:50:10,402 -- _send_packet len = 5
2016-12-01 23:50:10,404 -- storage info bytes: 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0
2016-12-01 23:50:10,404 -- _send_packet len = 4093
2016-12-01 23:50:10,452 -- _send_packet len = 4093
2016-12-01 23:50:10,498 -- _send_packet len = 4093
2016-12-01 23:50:10,545 -- _send_packet len = 4093
2016-12-01 23:50:10,593 -- _send_packet len = 4093
2016-12-01 23:50:10,641 -- _send_packet len = 4093
2016-12-01 23:50:10,689 -- _send_packet len = 4093
2016-12-01 23:50:10,737 -- _send_packet len = 4093
2016-12-01 23:50:10,785 -- _send_packet len = 4093
2016-12-01 23:50:10,832 -- _send_packet len = 4093
2016-12-01 23:50:10,880 -- _send_packet len = 4093
2016-12-01 23:50:10,927 -- _send_packet len = 4093
2016-12-01 23:50:10,974 -- _send_packet len = 641
2016-12-01 23:50:10,983 -- _send_packet len = 1
2016-12-01 23:50:11,097 -- APPS version: CC3x00VersionInfo((0, 4, 0, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-12-01 23:50:11,097 -- _send_packet len = 20
2016-12-01 23:50:11,100 -- File exists on target, erasing
2016-12-01 23:50:11,100 -- _send_packet len = 20
2016-12-01 23:50:11,103 -- Erasing file /sys/mcuimg.bin...
2016-12-01 23:50:11,103 -- _send_packet len = 21
2016-12-01 23:50:11,187 -- _send_packet len = 1
2016-12-01 23:50:11,190 -- get last status got 0x40
2016-12-01 23:50:11,190 -- Uploading file target/thumbv7em-none-eabi/debug/sensorweb-firmware.bin -> /sys/mcuimg.bin [175896]...
2016-12-01 23:50:11,190 -- file_len = 175896 bsize = 1024 blocks = 172
2016-12-01 23:50:11,191 -- _open_file = '/sys/mcuimg.bin', slfs_flags = 31ac
2016-12-01 23:50:11,191 -- _send_packet len = 26
2016-12-01 23:50:21,204 -- timed out while waiting for ack
Traceback (most recent call last):
  File "/usr/local/bin/cc3200tool", line 22, in <module>
    main()
  File "/usr/local/lib/python2.7/dist-packages/cc3200tool/cc.py", line 754, in main
    command.signature, command.file_size)
  File "/usr/local/lib/python2.7/dist-packages/cc3200tool/cc.py", line 626, in write_file
    self._open_file_for_write(cc_filename, alloc_size)
  File "/usr/local/lib/python2.7/dist-packages/cc3200tool/cc.py", line 488, in _open_file_for_write
    return self._open_file(filename, flags)
  File "/usr/local/lib/python2.7/dist-packages/cc3200tool/cc.py", line 497, in _open_file
    self._send_packet(command)
  File "/usr/local/lib/python2.7/dist-packages/cc3200tool/cc.py", line 371, in _send_packet
    "No ack for packet opcode=0x{:02x}".format(ord(data[0])))
cc3200tool.cc.CC3200Error: No ack for packet opcode=0x21

and here's the log for one that works:

+ cc3200tool -p /dev/ttyUSB1 --sop2 '~dtr' --reset prompt write_file target/thumbv7em-none-eabi/release/sensorweb-firmware.bin /sys/mcuimg.bin
2016-12-01 23:50:29,253 -- Connecting to target...
Reset the device with SOP2 asserted and press Enter

2016-12-01 23:50:34,834 -- timed out while waiting for ack
2016-12-01 23:50:35,092 -- Connected, reading version...
2016-12-01 23:50:35,092 -- _send_packet len = 1
2016-12-01 23:50:35,094 -- connected to target
2016-12-01 23:50:35,095 -- Version: CC3x00VersionInfo((0, 4, 1, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-12-01 23:50:35,095 -- This is a CC3200 device
2016-12-01 23:50:35,095 -- Switching to NWP bootloader...
2016-12-01 23:50:35,096 -- _send_packet len = 1
2016-12-01 23:50:35,097 -- Switching UART to APPS...
2016-12-01 23:50:35,098 -- _send_packet len = 5
2016-12-01 23:50:35,099 -- Resetting communications ...
2016-12-01 23:50:36,356 -- _send_packet len = 1
2016-12-01 23:50:36,358 -- Uploading rbtl3100s.dll...
2016-12-01 23:50:36,360 -- Getting storage list...
2016-12-01 23:50:36,360 -- _send_packet len = 1
2016-12-01 23:50:36,362 -- Getting storage info...
2016-12-01 23:50:36,363 -- _send_packet len = 5
2016-12-01 23:50:36,365 -- storage info bytes: 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x0
2016-12-01 23:50:36,365 -- _send_packet len = 4093
2016-12-01 23:50:36,412 -- _send_packet len = 4093
2016-12-01 23:50:36,460 -- _send_packet len = 4093
2016-12-01 23:50:36,508 -- _send_packet len = 4093
2016-12-01 23:50:36,555 -- _send_packet len = 4093
2016-12-01 23:50:36,603 -- _send_packet len = 4093
2016-12-01 23:50:36,651 -- _send_packet len = 4093
2016-12-01 23:50:36,698 -- _send_packet len = 4093
2016-12-01 23:50:36,745 -- _send_packet len = 4093
2016-12-01 23:50:36,793 -- _send_packet len = 4093
2016-12-01 23:50:36,841 -- _send_packet len = 4093
2016-12-01 23:50:36,888 -- _send_packet len = 4093
2016-12-01 23:50:36,935 -- _send_packet len = 641
2016-12-01 23:50:36,944 -- _send_packet len = 1
2016-12-01 23:50:37,058 -- APPS version: CC3x00VersionInfo((0, 4, 0, 2), (0, 0, 0, 0), (0, 0, 0, 0), (0, 0, 0, 0), (16, 0, 0, 0))
2016-12-01 23:50:37,059 -- _send_packet len = 20
2016-12-01 23:50:37,061 -- Uploading file target/thumbv7em-none-eabi/release/sensorweb-firmware.bin -> /sys/mcuimg.bin [77176]...
2016-12-01 23:50:37,062 -- file_len = 77176 bsize = 1024 blocks = 76
2016-12-01 23:50:37,062 -- _open_file = '/sys/mcuimg.bin', slfs_flags = 314c
2016-12-01 23:50:37,062 -- _send_packet len = 26
2016-12-01 23:50:37,698 -- After _open_file _send_packet
2016-12-01 23:50:37,698 -- Back from _open_file_for_write
2016-12-01 23:50:37,699 -- pos = 0
2016-12-01 23:50:37,699 -- _send_packet len = 4101
2016-12-01 23:50:37,755 -- _send_packet len = 1
2016-12-01 23:50:37,756 -- get last status got 0x40
.2016-12-01 23:50:37,756 -- pos = 4096
2016-12-01 23:50:37,756 -- _send_packet len = 4101
2016-12-01 23:50:37,811 -- _send_packet len = 1
2016-12-01 23:50:37,812 -- get last status got 0x40
.2016-12-01 23:50:37,812 -- pos = 8192
2016-12-01 23:50:37,813 -- _send_packet len = 4101
2016-12-01 23:50:37,869 -- _send_packet len = 1
2016-12-01 23:50:37,871 -- get last status got 0x40
.2016-12-01 23:50:37,871 -- pos = 12288
2016-12-01 23:50:37,872 -- _send_packet len = 4101
2016-12-01 23:50:37,928 -- _send_packet len = 1
2016-12-01 23:50:37,930 -- get last status got 0x40
.2016-12-01 23:50:37,930 -- pos = 16384
2016-12-01 23:50:37,931 -- _send_packet len = 4101
2016-12-01 23:50:37,986 -- _send_packet len = 1
2016-12-01 23:50:37,987 -- get last status got 0x40
.2016-12-01 23:50:37,988 -- pos = 20480
2016-12-01 23:50:37,988 -- _send_packet len = 4101
2016-12-01 23:50:38,042 -- _send_packet len = 1
2016-12-01 23:50:38,044 -- get last status got 0x40
.2016-12-01 23:50:38,045 -- pos = 24576
2016-12-01 23:50:38,045 -- _send_packet len = 4101
2016-12-01 23:50:38,100 -- _send_packet len = 1
2016-12-01 23:50:38,101 -- get last status got 0x40
.2016-12-01 23:50:38,101 -- pos = 28672
2016-12-01 23:50:38,102 -- _send_packet len = 4101
2016-12-01 23:50:38,157 -- _send_packet len = 1
2016-12-01 23:50:38,159 -- get last status got 0x40
.2016-12-01 23:50:38,160 -- pos = 32768
2016-12-01 23:50:38,160 -- _send_packet len = 4101
2016-12-01 23:50:38,215 -- _send_packet len = 1
2016-12-01 23:50:38,217 -- get last status got 0x40
.2016-12-01 23:50:38,217 -- pos = 36864
2016-12-01 23:50:38,218 -- _send_packet len = 4101
2016-12-01 23:50:38,273 -- _send_packet len = 1
2016-12-01 23:50:38,275 -- get last status got 0x40
.2016-12-01 23:50:38,275 -- pos = 40960
2016-12-01 23:50:38,276 -- _send_packet len = 4101
2016-12-01 23:50:38,331 -- _send_packet len = 1
2016-12-01 23:50:38,333 -- get last status got 0x40
.2016-12-01 23:50:38,333 -- pos = 45056
2016-12-01 23:50:38,333 -- _send_packet len = 4101
2016-12-01 23:50:38,389 -- _send_packet len = 1
2016-12-01 23:50:38,391 -- get last status got 0x40
.2016-12-01 23:50:38,391 -- pos = 49152
2016-12-01 23:50:38,391 -- _send_packet len = 4101
2016-12-01 23:50:38,447 -- _send_packet len = 1
2016-12-01 23:50:38,449 -- get last status got 0x40
.2016-12-01 23:50:38,449 -- pos = 53248
2016-12-01 23:50:38,449 -- _send_packet len = 4101
2016-12-01 23:50:38,504 -- _send_packet len = 1
2016-12-01 23:50:38,505 -- get last status got 0x40
.2016-12-01 23:50:38,506 -- pos = 57344
2016-12-01 23:50:38,506 -- _send_packet len = 4101
2016-12-01 23:50:38,561 -- _send_packet len = 1
2016-12-01 23:50:38,562 -- get last status got 0x40
.2016-12-01 23:50:38,562 -- pos = 61440
2016-12-01 23:50:38,563 -- _send_packet len = 4101
2016-12-01 23:50:38,618 -- _send_packet len = 1
2016-12-01 23:50:38,621 -- get last status got 0x40
.2016-12-01 23:50:38,621 -- pos = 65536
2016-12-01 23:50:38,621 -- _send_packet len = 4101
2016-12-01 23:50:38,677 -- _send_packet len = 1
2016-12-01 23:50:38,679 -- get last status got 0x40
.2016-12-01 23:50:38,679 -- pos = 69632
2016-12-01 23:50:38,680 -- _send_packet len = 4101
2016-12-01 23:50:38,735 -- _send_packet len = 1
2016-12-01 23:50:38,737 -- get last status got 0x40
.2016-12-01 23:50:38,737 -- pos = 73728
2016-12-01 23:50:38,737 -- _send_packet len = 3453
2016-12-01 23:50:38,784 -- _send_packet len = 1
2016-12-01 23:50:38,785 -- get last status got 0x40
.
2016-12-01 23:50:38,785 -- Closing file ...
2016-12-01 23:50:38,785 -- _send_packet len = 321
2016-12-01 23:50:38,790 -- _send_packet len = 1
2016-12-01 23:50:38,792 -- get last status got 0x40
2016-12-01 23:50:38,792 -- All commands done, bye.

I tried cc3200prog and it behaves the same way (works on my smaller release build, fails on the open of the larger debug build).

from cc3200tool.

kzyapkov avatar kzyapkov commented on July 30, 2024

Opening the file for writing fails, so that's very likely insufficient flash storage. I'll see if I can get the tool to show a more sensible error.

Did you try formatting the flash first, to make sure it's not fragmented?

Uniflash can dump some info from the file allocation table of FailFS and shows allocated blocks and free slots.

from cc3200tool.

dhylands avatar dhylands commented on July 30, 2024

ok - I finally got uniflash running and was able to list the files on the filesystem.

It shows that /sys/mcuimg.bin starts at block 230 and can go up block 255, which means that it has a max size of 26 blocks = 106,496 bytes.

So it looks like its not an issue with cc3200tool. Now I just have to figure out how to create new files so that I can erase the flash and repopulate.

from cc3200tool.

oleg-politechnik avatar oleg-politechnik commented on July 30, 2024

Experienced similar issue with writing a large file (1M), was able to fix it with the increased timeout.

My guess is that when this tool instructs cc3200 to allocate space for a file (SSFS does not support fragmentation -- that's why I need to allocate space in advance, in particular for OTA-able files), it takes significant time, depending on file size. Files of the size of up to ~250000 work with default timeout=5, but for larger ones cc3200tool has no chance to receive the ACK -- cc3200 is still busy allocating.

Two options there: either adjust serial port's timeout value automatically for large files, or provide user an option to change it (like --timeout). Or both.

from cc3200tool.

Related Issues (7)

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.