This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Bootstrap Loader over an USB to RS232-Converter with a MSP430F449

Other Parts Discussed in Thread: MSP430F449, MAX232

Dear Community,

I'd like to redisigne a PCB with a MSP430F449 on it. Because the moste newer PC's and Laptop's don't have a RS232-Port anymore.

I tried out the USB to RS232-Converter from FTDI (FT232RL)

With the VCP Driver 2.06.00

in the driver settings i set the latency to 1ms (the lowest i can)

and the UBS Packet-Size to 64 Byte (also the lowest i can)

I tried to download an 152KB Hexfile

Download Time over an HW RS232: 23 sec.
Download-Time over the FT232RL: 81 sec.

The download over BSL is necessary for our customer.
But they need a USB-Connection to download the SW.

Is there a possibility to make this Download faster?
Closer to a HW RS232?

best regards

F. Schmuki

  • I don't think it can be speed-up easily.

    USB is a really slow thing. The high throughput rates of USB usually shadow the fact that this is only for the continuous transfer of large data streams.

    If you transfer a single byte, it has to go through the same amount of software and hardware layers, added with routing information and whatever, as a large data block. This results in really poor performance. In fact, many gamers have complained a long time for the poor reaction times of mice which are connected through USB. (which is only 3 bytes data per mouse movement, yet the delay is noticeable for a human).

    There are some thing you can try.

    Some USB to serial converters have a buffered mode. This means you can send them a large data packet, whic is buffered locally (in the converter) and output to the serial port as fast as possible. This can speedup throughput.
    Unfortunately, you're just transferring a few hundred bytes at a time, then need to wait for ACK/NAK. So it won't help too much. Adjusting the USB packet size to the average data size that is to be transferred in a block might help (is it 128 bytes per block write command?)

    Increasing the latency time might help. It might allow collecting more data into one USB packet, thus avoiding unnecessary overhead. I think the minimum datasize from MSP to PC is 1 byte (ACK), so raising the latency would slow down here, but otoh anything that contains more than one byte could be bundled. Remember, at 9600Bd, each single byte takes more than 1 ms.

    You should experiment with different combinations of settings. The lowest is not always the best.

    And try a different brand off converter too.

  • Thanks Jens-Michael

    for your fast reply

     

    I' ve tried some different settings.

    with a latency of 4ms,

    a Inputbuffersize of 64 Bytes.

    a Outputbuffersize of 1024 Bytes and

    a Blocksize of (250 Bytes)

    the Download Speed is a little faster about 68 seconds.

    I used the msp430-bsl.exe (V1.6) to download the Software.

     

    Is it possible to make bigger Packages as 250 Bytes?

    Any other Ideas?

     

    Thanks F. Schmuki

  • The problem is that after each sent data block, the PC needs to wait for the acknowledgement.

    Maybe you know the term 'ping time'? It's an important parameter for online gamers. No matter how fast a DSL line you have, the delay from sending a single byte to its reception limits your reaction times.

    With USB it is the same. You can send a big bunch of data at once fast, but if you have to wait for each byte to be echoed, you'll spend most of the time waiting instead of transferring.

    With a hardware serial connection, the 'ping time' of the MSPs bootstrap loader is alsmost the plain time neede to shift the data through the serial line. But with USB, you'll add the time required for all the USB bus handling, addressing and the HUB management, as well as the varouis driver layers on PC, until this one single byte finally returns.

    Your own experiments show how 'lazy' USB is: same payload but the transmission time of 50KB (150k hexfile are transferred as ~50k binary data) has reduced by whopping 13 seconds or 16%. Still almost 200% overhead compared to hardware RS232.

    There are two possible solutions:

    1) build a (perhaps MSP based) device with two serial ports or one serial and an USB port (there are MSPs with USB controller). Send the hexfile to this device and let it do the actual BSL handling directly. It should bring you near the original speed. Especially since you can use full USB speed or 115.2KBd serial speed (with USB/RS232 converter) for the upload. Depending on the MSP used, you can raise your blockrate to almost 16KB (the MSP430F54xx have 16 kb ram). The 'programmer' still deals with a small blockrate, but is connected with the target MSP through hardware RS232. Another advantage of this approach: only the programmer device needs to have a level shifter (e.g. MAX232) on the PC side. If not using the USB version directly. The target device can communicate with the programmer without any interface circuitry, just plain (and cheap) pin-to-pin connection.

    2) write your own boot strap loader. You can upload it using the normal BSL communication (slow, but it is only a small program) and then execute it and it will load the final code with higher datarate, maybe stabilized by a quartz crystal, and with larger blocksize. This way you can be even faster than the original 23s. Not much, since writing to flash takes some time. But I guess, it should be possible to get below 10s.

    In both cases you'd be required to write your own PC software to support your own protocol.

**Attention** This is a public forum