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.
Hello,
Recently I made a project for cpu2 while I have existing code for cpu1.
On cpu1, i am using pwm, adc and inputxbar, while I am using spi and usart on CPU2.
The code works fine on both cpu if i dont add this line to cpu1 code - "InputXbarRegs.INPUT5SELECT = 8".
But when I add the above line to cpu1 code, the cpu2 code hangs and it keeps waiting either for spi send or usart send function.
Please tell me what is the link between InputXbarRegs.INPUT5SELECT on cpu1 and spi/usart on cpu2, I have an application on which I have to use both things(xbar on cpu1 and spi/usart on cpu2).
But i am not able to do so.
Please help me what wrong I am doing or is there any conflict.
Also I have one more doubt. When i use "IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);" function on cpu1, then only I am able to run both codes without debugger, and when i use this function, then I am not able to run the code with debugger. Pleas also tell what is the need of this function.
Please replay as soon as possible.
Hi Sanjay,
Could you tell me what package your are using, and what pins are being used for SPI and USART?
Thank you,
Luke
To answer your second question, this function should only work in standalone mode, since calling this function will cause the device to wait for an event that only happens in standalone mode.
I am using TMS320F28377DPTPS, and SPIA PINS(SPICLKB-63,SPISIMO-64,SPISOMI-65,SPI ENABLE-66),USART1 PINS(RX_PIN-85,TX_PIN-84,RS485_ENABLE_PIN-86),USART2 PINS(RX_PIN-11,TX_PIN-10,RS485_ENABLE_PIN-94),
Here pins 86 and 94 are gpio pins
Please tell me what is "standalone mode", is running without debugger is called "standalone mode"?
Hi Sanjay,
Yes, running without the debugger/booting from flash is considered standalone mode.
Could you verify that your GPIO mux options for GPIO8 are not selecting SCITXDA? Does this issue persist when configuring the InputXbar to select a different GPIO?
Thank you,
Luke
I didn't tried to select different io because in my application xbar is connected to gpio 8.
Which GPIO number are you using for your SPI/SCI?
The only thing about INPUT5 of the INPUTXBAR (INPUTXBAR5) is that it is directly connected to the EPWM SYNC Input.
And on this device that is by default the trigger for the EPWM1 PHS Sync. If you dont have EPWM1 PHSEN you should be okay with your EPWM.
For you PINMUX, maybe there is something incorrect in your setup. Do you have the GPIO8 configured as a GPIO or as a PERIPHERAL function? GMUX and MUX settings for the GPIO Pinmux options are worthy of a check.
On CPU2, how do you know it is hanging and on what line of code is it hanging? Is it waiting for a DATA RECEIVE?
I am using TMS320F28377DPTPS, and SPIA PINS(SPICLKB-63,SPISIMO-64,SPISOMI-65,SPI ENABLE-66),USART1 PINS(RX_PIN-85,TX_PIN-84,RS485_ENABLE_PIN-86),USART2 PINS(RX_PIN-11,TX_PIN-10,RS485_ENABLE_PIN-94),
Please also tell, I want to make a generic code that can run with and also without debugger, how should i use "IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);" function or is there any other way, because with debugger i need to comment IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH); function and for running without debugger I need to uncomment it back.
I believe your observation is correct. You need to comment out for debugger. Benjamin Collier please correct me if I am wrong.
Hi,
Yes, you will need the IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH) line to run your code on CPU2 without the JTAG debug probe. When running your code with the JTAG debug probe connected, it would be easiest to comment that line out to run your code.
You can find more details about how this function works and why you need it in this E2E post: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1211804/tms320f28375d-how-to-force-cpu2-to-go-into-main-after-reset
It would also be possible to run your program with the JTAG debug probe connected by resetting CPU2 so that CPU1 can bring it out of its wait state, which would allow CPU1 to get past the IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH) line.
Best Regards,
Ben Collier
Thanks problem is resolved. I removed that gpio pin initialisation from that place and used it some where else, so it is not causing any problem.