November 23, 2024, 12:05:05 AM

Unwanted SPI-to-UART echo

Started by Eugene, October 31, 2013, 04:12:27 PM

Previous topic - Next topic

Eugene

I connected AVR-H128-CAN pins RXD0/TXD0 via MAX232 to PC's COM port and ran a COM-port monitoring program. While uploading firmware code via AVR Dragon's SPI header I noticed the terminal received large number of data bytes.

Please advise how to disable this.

Thank you,

Eugene

LubOlimex

Hey Eugene,

Does this happen even if there is no code on the board? If still throws data on the COM then it throws some information from the "Boot Code Section".

This section might be disabled by correct adjustment of the "Boot Lock Bits".

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Eugene

I'm not sure what you meant "... there is no code on the board" - it's my understanding that during firmware upload the Dragon should erase entire chip first then load the new code. This new code gets echoed via UART during flashing process.

Is there boot code? If yes: is it being preserved during Dragon's erase phase? I had previously questioned what code AVR-H128-CAN comes with (see https://www.olimex.com/forum/index.php?topic=1754.0)

Please advise.

Thanks,

Eugene

LubOlimex

Hey Eugene,

I didn't see nor answer the question in the thread you linked. Please refer to page 321 (Boot Loader Support – Read-While-Write Self-Programming) of the user's manual of AT90CAN128 here: http://www.atmel.com/Images/doc7679.pdf.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex

Eugene

I'm afraid you did not understand me.

My question was - is there a bootloader code? If yes, will AVR Dragon erase it while loading my code?

You did NOT answer last time, please answer this time.

Thank you,

Eugene

LubOlimex

Hey there,

We program the boards two times and each time the flash memory is completely erased. We do that to test both ICSP and JTAG interfaces. According to the datasheet I linked the bootloader section might be deleted and the flash would be used as whole BUT it also can be protected by the respective lockbits. Generally, Atmel have provided an OPTION to use the boot sectors if you wish to add own bootloader. We haven't written such.

You might erase the flash completely since no special lockbits have been set by Olimex. Perform erase with the AVR Dragon. Then read the fuses and the lockbits and ensure no bootloader protection bits had been previously set. If such had been set, remove the protection bits, write the new bit position to the board and then erase again.

Please note that lockbits might be changed only after a valid "Chip Erase" command is issued. If you just perform write without a full stand-alone erase it would follow the rules that have been set by those lockbits. More info on erase might be found here: http://www.atmel.com/images/doc0943.pdf.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex