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.

run software with debugger vs. standalone Launchpad 28377S - SCI fail

Hi

I have a similar problem like this (e2e.ti.com/.../245727).

But with my SCI

1) When connected to the JTAG debugger, running in a debug session, the code executes as expected and the SCI outputs perfectly fine.

2) When I disconnect the JTAG, power cycle the device and run from flash (all program code is mapped to flash, not RAM in the memory map), the software is running and the SCI send my "I'm initalised" message out but it will not receive anything.

For receiving I check the FIFO level (SciaRegs.SCIFFTX.bit.TXFFST;) and I toogle a LED if I get some data.

This works fine with debugger connected but not without.

I think the answer for the upper question was

"It might be worth a double check. There are some functions in our standard examples (like sys int type functions, flash init) that are part of the ramfuncs. Thing is, this would fail in both a stand-alone and in debug so I doubt it is the root cause of your issues, but still worth checking."

Could you explain it please for what I should looking for?

Thanks and kind regards

  • Hello
    How do you know, that program is running is standalone mode? I mean, do you have a blinkind led or smth?

    About "...some functions in our standard examples.." - I think that user was talking about functions, that resides in RAM by default, so you should use "memcpy" function in the beginning of your main(). But I don't think it causes problem, because in this way your soft wouldn't be running even in debug mode (with jtag).
  • Hello Disona

    Yes, I tried to put a blinky LED at different places in my code (interrupt routine, main loop) - this is working and I think the code is running.

    It's its even enough if I just connect with the debugger and Launch the target configuration, connect and start - than it works.

    So whats the difference between this and without the debugger?

    Regards
    René
  • Hm.

    I guess your code runs properly even after reset in debug mode?

    Well, the main difference is that Debug-mode uses special GEL-files. These are some scripts for lots of purposes - they can clear ram-memory, when you connect, they can start/stop watchdog, when you press "Run", they are multi-purpose files, driven by your CodeComposerStudio events (attaching to MCU, flashing program, restarting and so on). This scripts can even init some peripherals.

    So i think they do some special job for you, which must be done by your code. It's hard to say what should be done exactly.

    You can start debug session, then in Debug Perspective go "Tools" - "GEL Files". There will be a window with availible gel-files for you MCU. Look which functions on such events as Start, Reset.

  • I think your are right - there must be something that the debugger do - but what is is it?

    And what has the debugger to do with the sci - rx.
    Tx is working I can send something out of the uC but the rx or fifo doesn't recognise anything at the input.
  • Have you tried to run the program in debug mode, then disconnect the debugger without stopping the program?
  • Yes, program still runs and works fine.
  • Is it a ti example, or your code? Have you tried TI examples?
  • I started with a TI example and modified it but to go back wouldn't help me.
    I found this

    e2e.ti.com/.../382771

    Here is mentioned that CCS over write the UART pin but is't an other uC - could it be the same for the 28377?
  • Well yes, this is possible, but not necessary. Anyway, have you muxed RX and TX properly? Can you show your init code or tell, which example have you changed?

  • void init_serial_com(uint32_t u32LSPCLK, uint32_t u32BaudRate) {
    	char *msg;
    
    	// MUX settings out of Table 4-1, Datasheet (SPRS880A)
    	// SCI - C
    	// GPIO90/EM1A17/EM1DQM2/SCIRXDC => hene UART
    	// GPIO89/EM1A16/EM1DQM1/SCITXDC => hene UART
    	GPIO_SetupPinMux(90, GPIO_MUX_CPU1, 6);
    	GPIO_SetupPinOptions(90, GPIO_INPUT, GPIO_PUSHPULL);
    	GPIO_SetupPinMux(89, GPIO_MUX_CPU1, 6);
    	GPIO_SetupPinOptions(89, GPIO_OUTPUT, GPIO_ASYNC);
    
    	UARTConfigSetExpClk(UARTC_BASE, u32LSPCLK, u32BaudRate,
    	UART_CONFIG_WLEN_8 | UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE);
    
    	//ScicRegs.SCILBAUD.all    = 0x0035;
    	UARTFIFOEnable(UARTC_BASE);
    
    	msg = "\r\initialized!\0";
    	send_msg(msg);
    }
    
    static void send_msg(char * msg) {
    	int i;
    	i = 0;
    	while (msg[i] != '\0') {
    		scic_xmit(msg[i]);
    		i++;
    	}
    }
    
    static void scic_xmit(int a) {
    	while (ScicRegs.SCIFFTX.bit.TXFFST != 0)
    		;
    	ScicRegs.SCITXBUF.all = a;
    }

  • Hm. Sorry. F28377 is little different from what i have worked with, so i guess i can't help here =(
  • I got it. I have to enable the pullup at the rx pin (pin 90) - after that it works.
    I checked if the debugger enabled it (because with them it works) - but he didn't.
    I don't know why but it works. I have a WLan Modul (EMW3165) with a 33 Ohm in-line resisitor at rx and tx at the other end.
    Thanks for your help Disona.