Other Parts Discussed in Thread: TM4C1294NCPDT, TM4C1294KCPDT, LM3S8971
Hello group,
Attempted various ways to get Serial bootloader (BL) to vector jump address (0x2c). Or even 0x04 (ResetISR()) as to assert UpdateHandler() or EnterBootLoader() via Thumb code explicitly via BL table offset 0x2C.
The application launches 0x4000 without issues. Yet calling the jump 0x2c via application as do both Tiva examples seems to cause watchdog resets when dogs are disable prior to jump. The BL code flow used to work fairly well via Stellaris MCU via the TFTP server client. Seemingly TM4C jump to 0x2c is not vectoring to where the BL vector table calls SRAM 0x2000.0000. BL is not hard faulting at this point only resets after a while.
I placed several LED toggles in the bl_emac.c code path but LED D1-D4 only turn on and never off as instructed below, until BL unexpected reset event. The PDF text misstates update via BootP without EMAC re-configuration is left over form Stellaris MCU and should be appended. Any ideas why the jump address 0x2C might not execute from BL vector table defined entries ENET_ENABLE_UPDATE as bl_config.h has un-commented? I don't see why MOSC should need to be reconfigured after jumping 0x2c if BL is not immediately resetting MCU. The 25mHz MOSC seems to be running as Ethernet client is active prior jumping 0x2c.
Text: Additionally, the application can call the boot loader in order to perform an application-directed update. In this case, the boot loader assumes that the application has already configured the peripheral that it will use for the update. This allows the boot loader to use the peripheral as is to perform the update. The boot loader also assumes that the interrupt to the core has been left enabled as well, which means that that application should not call IntMasterDisable() before calling the boot loader. Once the application calls the boot loader, the boot loader copies itself to SRAM, branches to the SRAM copy of the boot loader, and starts the update by calling Updater() (for UART0, SSI0, and I2C0), UpdateBOOTP() (for Ethernet), AppUpdaterCAN() (for CAN) or AppUpdaterUSB() (for USB). The SVCall entry of the vector table contains the location of the application-directed update entry point.
BootP via (TFTP) server requires BL calling UpdateBootP() where setup of UIP asserts via EnetReconfig() and resetting EMAC0 inside BL. So it can not use the fast updater() as described above without doing a full EMAC reconfiguration. What might be going on here? Where is Updater() in the BL Thumb code, it does not seem to exist?
The application jump and 2nd snip configureEnet() does toggle 4 LEDS On, then MCU resets. Skipping over configureEnet() and Thumb vector table calling BootP() the same reset occurs as if the jump address 0x2c is off by 4 byes in the vector table hard offset addresses.
//***************************************************************************** // //! Configures the Ethernet controller at bootloaders initinalizaition. //! //! This function configures the Ethernet controller, preparing it for use by //! the boot loader. COnfigure the GPIO LED Port Pins //! //! \return None. Called via bl_startup_ccs.s // //***************************************************************************** void ConfigureEnet(void) { // // Make sure the main oscillator is enabled because this is required by // the PHY. The system must have a 25MHz crystal attached to the OSC // pins. The SYSCTL_MOSC_HIGHFREQ parameter is used when the crystal // frequency is 10MHz or higher. // //HWREG(SYSCTL_MOSCCTL) = SYSCTL_MOSC_HIGHFREQ; // // Delay while the main oscillator starts up. // //Delay(5242880); /* MPU uses MOSC driven PLL 480mHz/4 produce 120 MHz SYSCLK: Y1 = 25mHz XTAL HIGHFREQ. */ //while(g_ui32SysClock != 120000000) { //g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | // SYSCTL_OSC_MAIN | //SYSCTL_USE_PLL | //SYSCTL_CFG_VCO_480), 120000000); } // //! Configure SysTick with 24ms periodic interrupt for the user functions. //! EthernetSendRealTimeData() tick rate via TM02 //ROM_SysTickPeriodSet(120000000 / SYSTICKHZ); //ROM_SysTickEnable(); //ROM_SysTickIntEnable(); #ifdef ENET_ENABLE_LEDS // // PF0/PF1 are used for Ethernet LEDs. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); /* Link LED-0 */ ROM_GPIOPinConfigure(GPIO_PF0_EN0LED0); //EKXL_LED0:PF0, CPCB:PK4 /* Activity LED-1 */ ROM_GPIOPinConfigure(GPIO_PF4_EN0LED1); //EKXL_LED1:PF4, CPCB:PK5, PF1:EN0LED2 //Configure PHY LEDS for Link, Activity at 2ma. GPIOPinTypeEthernetLED(GPIO_PORTF_AHB_BASE, GPIO_PIN_0 | GPIO_PIN_4); // Set the LED pad(s) for standard push-pull operation. MAP_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);//CPCB:PK4 MAP_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD); //CPCB:PK5 /* Enable GPIO-N peripheral */ ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION); /* Run LED N1 */ ROM_GPIOPinTypeGPIOOutput(PIN_LEDRUN_PORT, PIN_LEDRUN_PIN); MAP_GPIOPadConfigSet(GPIO_PORTN_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);//CPCB:A2 /* Fault LED N0 */ ROM_GPIOPinTypeGPIOOutput(PIN_LEDFAULT_PORT, PIN_LEDFAULT_PIN); MAP_GPIOPadConfigSet(GPIO_PORTN_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);//CPCB:A3 // Turn Run LED On, fault LED On ROM_GPIOPinWrite(PIN_LEDRUN_PORT, PIN_LEDRUN_PIN, PIN_LEDRUN_PIN); ROM_GPIOPinWrite(PIN_LEDFAULT_PORT, PIN_LEDFAULT_PIN, PIN_LEDFAULT_PIN); SysCtlDelay(120000000 * 4); // Turn Run LED On, fault LED Off ROM_GPIOPinWrite(PIN_LEDRUN_PORT, PIN_LEDRUN_PIN, 0x0); ROM_GPIOPinWrite(PIN_LEDFAULT_PORT, PIN_LEDFAULT_PIN, 0x2); SysCtlDelay(120000000 * 4); // Turn Run LED On, fault LED Off ROM_GPIOPinWrite(PIN_LEDRUN_PORT, PIN_LEDRUN_PIN, 0x1); ROM_GPIOPinWrite(PIN_LEDFAULT_PORT, PIN_LEDFAULT_PIN, 0x0); #endif // // // // Enable and reset the Ethernet modules. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_EMAC0); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_EPHY0); ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_EMAC0); ROM_SysCtlPeripheralReset(SYSCTL_PERIPH_EPHY0); while(!ROM_SysCtlPeripheralReady(SYSCTL_PERIPH_EMAC0)) { } }
/* System memory map */ MEMORY { FLASH (RX) : origin = 0x00000000, length = 0x00080000 SRAM (RWX) : origin = 0x20000000, length = 0x00040000 } /* Section allocation in memory */ SECTIONS { GROUP { .intvecs: .text .const .cinit : > FLASH .pinit : > FLASH .data .init_array : > FLASH //added } load = FLASH, run = SRAM, LOAD_START(init_load), RUN_START(init_run), SIZE(init_size) GROUP { .vtable: > 0x20000000 //added .bss .sysmem .stack } run = SRAM, RUN_START(bss_run), RUN_END(bss_end), SIZE(bss_size), RUN_END(__STACK_TOP) }