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.

F28M35 Serial Programming using Uniflash UART0

Other Parts Discussed in Thread: UNIFLASH

Hi,

I'm trying to program a custom F28M35 board with Uniflash over UART. I'm using U0 over GPIO0 (PA0) and GPIO1 (PA1) as specified in the datasheet.

I can program both cores just fine with an XDS100v2 and things like blinking LEDs and UART work as expected (timing / clock / GPIO etc. seem fine).

The UART is brought out over an FT232 USB-UART chip to the PC. I'm putting the board into Serial Boot mode by setting the boot pins to B0 = 0, B1 = 1, B2 = 0, B3 = 0 and then resetting the board. 

On both Windows and Linux, I'm unable to program over UART.

The error I see is the following:

[16:26:46] Begin Writing flash memory operation.
[16:26:46] Loading program: C:\Users\<username>\CodeComposerWorkspace\uartecho_F28M35H52C1_CortexM\Debug\uartecho_F28M35H52C1_CortexM.out
[16:26:52] Cortex_M3_0: Loading Concerto M3 flash kernel, this may take a few minutes...

[16:26:55] Cortex_M3_0: Concerto M3 flash kernel has been successfully loaded.

[16:27:01] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

[16:27:06] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

[16:27:06] ERROR >> Cortex_M3_0: File Loader: Memory write failed: Unknown error

[16:27:06] ERROR >> Cortex_M3_0: GEL: File: C:\Users\<username>\CodeComposerWorkspace\uartecho_F28M35H52C1_CortexM\Debug\uartecho_F28M35H52C1_CortexM.out: Load failed.

[16:27:06] File: C:\Users\<username>\CodeComposerWorkspace\uartecho_F28M35H52C1_CortexM\Debug\uartecho_F28M35H52C1_CortexM.out: Load failed.
[16:27:07] Operation Writing flash memory returned. 
[16:27:11] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

I've tried some of the suggestions on the forums here like trying twice - once with a slower baud, then with a faster baud ( https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/275682

Is there something I'm missing in setting up the board for serial flashing?

Thanks,

Aditya

  • Aditya,

    Which version of UniFlash are you using?

    Would you mind email me(xxxxxx@ti.com) that file you are trying to load for me to give it a try here? 

    Try erase the device through serial. Does that work for you?

    Victor

  • I'm using the latest version (3.4). Installed it today through the web installer. On linux, I've been trying for a couple of days, but I'm assuming that's still the latest version (only a couple of days old).

    If I try to erase the M3 core, I get the following:

    [17:42:01] Begin Launching session operation.
    [17:42:02] Operation Launching session returned.
    [17:42:02] Loaded target configuration from: C:\Users\gaddama\Desktop\board.ccxml
    [17:44:16] Erasing flash sectors on Core 0 < C28x Serial Connection/Cortex_M3_0 > ...
    [17:44:16] Begin Erase Flash operation.
    [17:44:21] Cortex_M3_0: Loading Concerto M3 flash kernel, this may take a few minutes...

    [17:44:24] Cortex_M3_0: Concerto M3 flash kernel has been successfully loaded.

    [17:44:30] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

    [17:44:40] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

    [17:44:50] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error

    [17:44:50] ERROR >> Cortex_M3_0: <!>Serial Communication exception: Please reset the device and try again!

    [17:44:50] Unknown error
    [17:44:51] Operation Erase Flash returned.

    I've emailed you the .out file I'm trying to program as you directed.

    Thanks,
    Aditya
  • Aditya,

    I tried you .out file and had no problem loading it to my h521 control card.

    You said you were trying on linux? from the log it appears you are on windows.

    Also, try erase the board completely by JTAG before trying to flash it with UART.

    Victor

  • I had tried in both operating systems. I tried Windows that last time to make sure it wasn't something to do with the drivers / Uniflash on Ubuntu. 

    One thing I did find is that when my custom board was powered by the USB hub on my monitor, even the XDSv2 couldn't  program properly. When connected to a powered USB hub, it worked. Serial programming still doesn't work however.

    Erased both cores with the XDS but no luck serial programming afterwards either.

    Given my earlier comment with the powered USB hub, I powered the board with a power supply instead and used the FTDI chip + USB just for the communication portion and still no luck.

    To clarify:

    1. My PC is communicating to the Concerto IC through an FT232 IC as a USB-UART connected to UART0 on PA0 and PA1. 

    2. Before I do any flashing, I set a DIP switch I have connected to BOOT_0 through BOOT_3 to 0b0010 to make it boot into boot from serial mode (as per page 179 on datasheet http://www.ti.com/lit/ds/symlink/f28m35h52c.pdf

    3. I then reset the board

    4. Ask uniflash to flash the board over UART

    Does the above sound fine as far what I have to do for the hardware side + the process? Does Uniflash always look at the UART at 115200 Baud? Or is there something I have to do on the concerto side for that? Is there some way to get more verbosity from Uniflash to maybe point me to what is actually failing in the Serial interface? 

    Thanks,

    Aditya

  • Aditya,

    Just to be sure, please confirm that you are using v3.4.1.00012 as previous version had problem with serial programming.

    I believe 115200 is the default setting for the bootrom and most tested, please stick with that if possible.

    You have uploaded the "flash kernel" successfully, so I believe the flash failed somewhere during the write as we are just getting back garbage from the flash kernel on the UART, indicated by this line: '[17:44:30] ERROR >> Cortex_M3_0: Error occurred during flash operation: Serial interface error'. Therefore, not much to go from that side.

    Try to erase the M3 core using serial connection. See if you get the same error.

    Did you enforce the Baudrate somewhere else? Configured some jumpers wrong? I don't know too much about the hardware detail other than the boot switch setting.

    Victor
  • I'm using that exact version (v3.4.1.00012).

    The schematic for the UART portion is very simple. There's two lines that go directly from the IC to the header out of the board. A FTDI interface board translates to USB and vice versa. Nothing I can see that would limit this to any specific baud (I don't know what I could really do to even do that).

    Erasing over serial gives me similar errors.

    For clocking, I have a 10MHz input from an external oscillator. I'm using the same settings for the PLL in Uniflash that I do when I run the UART echo demo from CCS. I'm not familiar with how Uniflash or the IC decides I have a single ended oscillator hooked up to X1 (and nothing to X2 as per the datasheet). Is there something I should specifically setup in Uniflash for my oscillator setup?

    Do I need hardware flow control on the UART for programming purposes?

    Thanks,

    Aditya

  • Bump.

    I'm still unable to do this. Does Uniflash expect some specific oscillator setup to work? 

  • Aditya,

    I am trying to get the BU applications engineer to look at this for you as we are not expert in hardware.

    As we can't think of why it didn't flash, and I can't reproduce your error on a control card, I want to be sure the serial setup is correct. There could also be jumper settings that cause the flash to fail. That's where I am not too sure about.

    Do you happen to have a control card that you can try on? You will need to wire the UART pin to the onboard emulator circuit though.

    Victor

  • And yes I believe you need hardware flow control for the UART.
  • I don't have a control card with me right now. My co-worker at a different location has used it before with his control card setup. I'm sure it's not a bug or something with Uniflash when it concerns evaluation boards, but I'm not sure how Uniflash or the bootloader knows how to find the right baud etc.

    I looked through the technical manual and I see no mention of hardware flow control. I don't even see of support for hardware flow control in the F28M35 (i.e. no pins for it).

    I'll wait for word from your applications engineer. I can also provide some schematics via email if needed.
  • Just another bump. I'm still looking for some help here. I can send some schematics if that helps.

    Thanks,
    Aditya

  • Hi,

    I was wondering if your applications engineer was able to shed some light on this. I'm still trying to get Uniflash to work over serial. Please advise. This is really a show stopper for us.

    As I said before, I can share more details about my schematic and my design if needed.

    Thanks,
    Aditya
  • Aditya,

    I asked our applications engineer to take a look at your schematics. Please post them.

    Quick question: You mentioned in your post that you have configured "BOOT_0 through BOOT_3 to 0b0010 to make it boot into boot from serial mode". But it should be BOOT_3 through BOOT_0 that needs to be configured as b0010 and not BOOT_0 through BOOT_3. Please make sure you did this correct.

    Thanks and regards,
    Vamsi
  • Can I email the schematics somewhere? I'd rather not post all of it here.

    My boot pins are being set to:

    BOOT_0 = 0
    BOOT_1 = 1
    BOOT_2 = 0
    BOOT_3 = 0

    which according to the datasheet is SCI boot mode.
  • board-limited.pdf

    I've attached some snapshots of the schematic. As I said, it's fairly simple as far as the UART goes. The BOOT pins I've made sure are the right settings with a multimeter (BOOT_0, BOOT_2 and BOOT_3 are at 0V and BOOT_1 is at 3V). The input clock is currently 10MHz.

    Please let me know if you need more information.

    Thanks,

    Aditya

  • Since my last post, I've looked at the setup on the control card and saw that it uses 20MHz as the input. So I fed 20MHz to my board and Uniflash works.

    So either there is a bug in the Uniflash UI or I'm not understanding how to use it. Because I've setup Device Settings to use 10MHz as the external oscillator and that does nothing. But if I leave all the settings default and use 20MHz as the external source it works. Does Uniflash only work with 20MHz as the oscillator input??
  • Aditya,

    Looking at your schematics I don't see any issues that immediately stand out. I think a good next step in this debug would be to isolate the location of the problem - a good way to to this would be to scope the M_U0TX and M_U0RX signals at pins 5 and 6 of hte MCU. This will determine whether the problem lies with FT232 or inside the MCU.

    Regards,
    PEter

  • Peter,

    Thanks for looking at the schematics. I've already ruled out the FT232 since I can send UART data fine if I program the MCU over JTAG. For example, the uart echo example works just fine once I've programmed over JTAG.

    I just double checked and Uniflash definitely works if I feed in 20MHz from my external clock but if I feed in 10MHz, it doesn't work. Is there something special I have to do for Uniflash to support oscillators other than 20MHz as the external clock source (besides editing the Device Settings in Uniflash)?

    Thanks again,
    Aditya

  • Aditya,

    I inquired with the UniFlash serial tool developers and they confirmed that UniFlash serial requires a 20MHz clock and does not work with other clocks. It is implemented assuming 20MHz as the clock source to configure the baud rate.

    I will ask the GUI development team to highlight this in GUI if it is not already done so.

    Thanks and regards,
    Vamsi
  • Thanks for confirming this. Can you guys please mention this somewhere on the GUI or the quick start pages? This was a huge waste of time not knowing this limitation. Just a note on the Quick Start wiki would have been sufficient. The fact that the GUI lets you input Device Settings including the external oscillator frequency is also misleading.

    - Aditya

  • Aditya,

    Sorry for the confusion. I asked the GUI developers to highlight this on GUI. I will also ask them to remove the "External oscillator frequency" setting as a input field and instead ask them to fix it for 20MHz and highlight the note next to it.

    Thanks and regards,
    Vamsi