On developing for the F28M35x chip I'm noticing strange behavior in trying to initialize the analog subsystem so I can use the ADC functionality.
The odd part is that it works correctly when loading the exact same binaries via jtag and running from there, but on power reset with the programs loaded into flash, it is unable to successfully run the provided InitAnalogSystemClock function. Specifically the C28 is calling this from main:
int Analog1_Config, Analog2_Config; DINT; // Global Disable all Interrupts IER = 0x0000; // Disable CPU interrupts IFR = 0x0000; // Clear all CPU interrupt flags PieCntlInit(); PieVectTableInit(); EALLOW; // below registers are "protected", allow access. SysCtrlRegs.LOSPCP.all = 0x0002; // Sysclk / 4 (**ReadAnalogClockStatus)(AnalogConfig2); int successCode = 0; while(successCode == 0) { *(unsigned int*)0x4E58 = 7; //added for errata workaround dmh 11/25/2013 successCode = (**InitAnalogSystemClock)(ACLKDIV2); //(ACLKDIV2); //(ACLKDIV4); }
Note that I'm also doing the following in M3:
HWREG(SYSCTL_MWRALLOW) = 0xA5A5A5A5; // Sets up PLL, M3 running at 75MHz and C28 running at 150MHz SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xf) | SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 | SYSCTL_XCLKDIV_4); SysCtlSubSystemReset(SYSCTL_ANALOG_SYSTEM_RES_CNF);
before later booting from flash.
Digging more into it, InitAnalogSystemClock tries to edit memory at the reserved section directly after the IPC registers, and this memory seems immutable when ran from flash. When I then reload the image via jtag and run the M3, it can write to some of these locations.
Additionally, I have commented out most of the initialization/setup code out of the gel file for the M3 in case one of those was making it work. Unfortunately this had no effect.
Could I get information on what conditions could cause this issue? Is there any data source on what is in the reserved block and how it pertains to the analog subsystem?