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.
Hi,
I'm having a very weird problem here, I'll try to explain as detailed as possible:
I'm developing quite a big application using both cores of the Concerto F28M35H52C1 (using the DIMM 100 USB dock) and everything is working fine until I power down my board for the whole night.
I mean, I can flash both cores, run both cores with the JTAG, I can power off the board flip the dip-switches on it and boot again without the JTAG, but when I go home and power everything off for the night and come back on the other day C28 does not boot properly. So it seems. Let me go through the boot up of my code.
M3 starts and setups the clock
// Sets up PLL, M3 running at 100MHz and C28 running at 100MHz
SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xA) | SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_1 | SYSCTL_XCLKDIV_4);
Initialises all peripherals (SysCtlPeripheralEnable) setup the GPIO pins and its initial values, setups the UART port, setup the I2C bus, read the EEPROM, copy time critical code to RAM, call FlashInit(), setup the shared RAM by giving C28 access to its writable areas, give C28 GPIO access
// give GPIO access to C28
GPIOPinConfigureCoreSelect(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5), GPIO_PIN_C_CORE_SELECT); // PWM pins
GPIOPinConfigureCoreSelect(GPIO_PORTC_BASE, GPIO_PIN_6, GPIO_PIN_C_CORE_SELECT); // LED pin
ask for C28 to boot and WAIT FOR IT TO BOOT:
// Send boot command to allow the C28 application to begin execution
IPCMtoCBootControlSystem(CBROM_MTOC_BOOTMODE_BOOT_FROM_FLASH);
// Lock M3 until C28 is ready
while (!IPCCtoMFlagBusy(IPC_FLAG17)) { }
IPCCtoMFlagAcknowledge(IPC_FLAG17);
then, and only then, it setups the Timed interruptions and the ethernet!
On the 500ms timed interruption it's simply blinking one of the LEDs (M3_LED) and sending some update info to the LCD screen via UART1.
---------------------------------------------------------------------------------------------------------------------------------------------
Now through the C28 boot code it (among other stuff) make C28_LED pin an output
EALLOW;
GpioG1CtrlRegs.GPCDIR.bit.GPIO70 = 1; // make it an output pin
EDIS;
initialise and start the 500ms timed interruption, turn on C28_LED, tells M3 that it's all setup and ready to go:
// Flag to M3 that the variables are ready in MSG RAM
IPCCtoMFlagSet(IPC_FLAG17);
and at the end enables global and higher priority real-time debug events.
---------------------------------------------------------------------------------------------------------------------------------------------
So the problem is:
with JTAG connected, flashing the code on both cores, resetting the cores, resetting the system, restart C28 (it goes to run), restart M3 (it goes to int main() ), run M3, M3 starts C28 and it stops on int main(), M3 stops waiting for C28, I start C28 core, it flags for M3 and both execute as expected. Blinking LEDs, updating LCD info, I can send ethernet commands that write to the eeprom and triggers an IPC on C28 to read the new data from the shared RAM... all working! On that part the control card switches are: SW1 and SW3 all up (closer to the ethernet connector).
without the JTAG: the above was running and I power off the board on the USB switch and remove the mini-USB from the side and flip SW1 all down (boot from flash) and SW3-pin1 down (no JTAG). I power the board on again and I see everything is working just as before. The board boots, both LEDs blinking, info on the LCD being updated, ethernet commands work. Even thou I can't connect the JTAG in this mode to see what C28 is doing, because both LEDs are blinking I'm assuming that C28 boot properly, initiated the timers and flagged M3 to run.
the next day: same setup from above, didn't change not even one switch, didn't flash any other code, didn't touch it. Turn off my PC, go home, have a night of sleep, the next day come to work again and..... M3_LED blinks, LCD info updated, ethernet commands apparently working (because I can't connect JTAG I can't confirm that it's doing what is supposed to) but C28_LED is not blinking.
And that makes no sense, if C28 didn't boot, it wouldn't allow M3 to boot neither. But M3 seems to be booting and C28 does not. On the other hand, even thou M3 seems to be booting fine, I tried send ethernet commands that would write the EEPROM, but it seems that it's not writing anything at all.
So it seems that after long power down the board is booting up to some weird limbo state that some stuff works and some doesn't.
Attached are my 2 Linker files which are copies from the generic_flash_wshared_M3 and generic_flash_wshared_C28;
Hi,
are you able to connect JTAG to the board now and reproduce the status you describe above in 'with JTAG connected' paragraph?
Best Regards
Santosh
hi Santosh,
thanks for the interest in my thread.
The only way I get this weird/not expected behaviour is after a long power off.
And as far as I know, if I power off, CCS loses connectivity, and to be able to debug again I would have to reflash the code.
Is there a way to, on CCS, to "Load the debug configuration", connect to the cores, and then make CCS understand that those cores have the code from my currently open project without flashing the code again on it? Did you understand my question? Cause the only way I found to pause and step through the code is to flash the cores.
Hi Ronaldo
I don't understand what you mean by it doesn;t boot after along power off but works after quick power off/reset? If there is a problem with boot it shouldn't boot after any power off/ON.
Ronaldo Pace said:And as far as I know, if I power off, CCS loses connectivity, and to be able to debug again I would have to reflash the code.
Is there a way to, on CCS, to "Load the debug configuration", connect to the cores, and then make CCS understand that those cores have the code from my currently open project without flashing the code again on it?
you don't have to re-flash your code, everytime you want to debug if you don't change the code. Just 'LOAD SYMBOLS' instead of loading the COFF files. Here is what you can do to findout whats going on when you say after a POWER ON your application is not running.
1.> Power ON the device without connecting to CCS.
2.> Not connect CCS to target and load symbols (it should be there in/around the same drop down menu you used to load the COFF file)
Can you load symbols and run the application and confirm that it is working? Now if that works then you should follow below:
1.> terminate existing debug sessions, power off and ON the board (Ibeleive the device is not booting)
2.> Open your Target config in CCS
3.> Remove your GEL Files
4.> save Target config and launch the target config and connect to both the cores.
5> load symbols on both the cores and see where the PC is stuck at.
Let us know if above helps.
Best Regards
Santosh
Ronaldo,
before you debug anything, it might be worth a while to check if your boot mode pins are set to boot-to-flash, on stand-alone boot device will boot to flash only if boot mode jumpers are set appropriately.
Please refer to device TRM boot ROM chapter and control card manual for the boot mode options and jumpers.
Best Regards
santosh
Hi Santosh,
thanks for taking the time to answer and sorry, for the late reply, I've been away from the office.
Your info about Loading Symbols is great and it will help me, not just on this problem, but on the whole development.
Furthermore,
I GUESS I managed to connect and see what's happening on C28.
It seems that it boots up (that way it allows M3 to carry on), but it's going to __interrupt void ILLEGAL_ISR(void). Is there a way on the registers to find which interrupt could be causing that? At the moment I have the 3 timers and the IPC interruptions going on.
Hi Ronaldo
good to hear, is the ILLEGAL ISR being triggered while your applicaiton is running after you re-base the NVIC?
Put a break point in the ILLEGAL ISR and when it breaks, you can tell which interrupt triggered this by looking at the NVIC registers, look for the ACK/FLAG registers i nthe NVIC register base. I hope you are doing debug reset before loading code.
are you booting device to flash or do you use any boot mode(s)? I beleive you are very close to get this working.
Best Regards
Santosh
Hi Santosh,
well, I've noticed some stupidity of my part on the timers initialisation.
So I just it now, changed the switches to load from flash, and now I'm going home. On Monday I'll see if the problem persist, if it does I'll check the NVIC registers as you said.
let's see how it goes. I'll report back.
yes it was my fault.
You know when u're developing something following the example, and at some point you think "hey, I'll change this to here to make it more organized" ??
Well, I moved the timer interruptions #pragma CODE_SECTION to another area of the RAM that is not the 'ramfuncs'
I'm very sorry for taking your time.
Regards,