2013-07-14 07:50 PM
I am trying to run the ST USB host example code via IAP over ethernet on an STM32F4G EVAL board. The IAP over ethernet appears to be working fine - I can compile, load and run various test applications (e.g. SysTick examples etc) and all appears to work fine. Applications are compiled to run from address 0x08010000 and as per the Ethernet IAP AN3226 I have set #define VECT_TAB_OFFSET 0x10000 and modified the linker script accordingly. The .map file confirms that the vector table is indeed at 0x08010000.
While this all works perfectly for the SysTick example, when I do the same to the USBHost HID example (which works perfectly when built for and run from 0x08000000), the interrupts don't fire. AN3226 states that to compile an application for IAP, I need to:- relocate the vector table using VECT_TAB_OFFSET or NVIC_SetVectorTable (Done, using the former. EDIT: Also just tried using NVIC_SetVectorTable just in case there was a difference, but behaviour was identical.)- build the application to run from the start address of the user flash area (0x08010000) (Done, as per the Ethernet IAP examples).- Ensure that the user code size does not exceed the size of the flash (Not even close).Is there something else I have to do (or not do) in order to get this to work? The first interrupt is the TIM2 timer, which doesn't seem particularly specific to the USB example, so I don't think there's anything about the USB host examples that would cause this - more likely to be the way I'm compiling/linking, but given that the .map file says my vector table is in the right place, and the IAP code is making the jump to the application fine (LEDs light up etc). I'm not sure what to check next - any pointers would be much appreciated.Build environment is CodeSourcery Lite and Eclipse.TIA, Dave.2013-07-16 09:41 PM
Some additional information/follow-up:
I don't have a debugger, so getting information is tricky, however I can now see that the TIM2 interrupt *IS* firing, but that it is being handled by the old (IAP) vector table, i.e. the program counter is pointing to the default interrupt handler in the IAP code. This suggests that although I thought I had relocated the vector table, the core is still using the IAP bootloader's vector table. This would also explain why the Systick example still works while others don't - in both cases (IAP and application) the Systick interrupt handler is just implementing a delay, so it doesn't matter which vector table is in use. So my question is now: Given that I have tried relocating the vector table using VECT_TAB_OFFSET and NVIC_SetVectorTable() why is the core still going back to the IAP's vector table to handle the TIM2 interrupt, and how can I (correctly) get it to use the correct (new) vector table?Any help much appreciated!