2011-02-20 10:06 AM
2011-05-17 05:25 AM
2011-05-17 05:25 AM
Well here are a couple of thoughts.
Look carefully at what you initialize in each partition. Try calling/starting the second partition at earlier times from within the first. Do a binary search to figure out what differs. Look at enabled interrupts, vector address (0x200 boundary) and service routines, perhaps you are firing an unhandled interrupt. Add in debug/diagnostic code to dump out peripheral and clock settings. Start with clock and reset registers. Dump out large portions of the register maps in hex, compare them between the two partitions, use fc/comp to spot differences.2011-05-17 05:25 AM
2011-05-17 05:25 AM
2011-05-17 05:25 AM
2011-05-17 05:25 AM
Are you using any interrupts in the bootloader? You must turn off all enabled interrupts in the bootloader before jumping to the application.
Have you forgotten to relocate the interrupt vector table in the application?For example: NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x8200);
2011-05-17 05:25 AM
Does the SPI Flash device have a reset pin? Are you leaving it in an invalid state?
2011-05-17 05:25 AM
2011-05-17 05:25 AM
Get some small code example that demonstrates this failure.
If it's not coming out the pins then you need to look at the GPIO settings, and confirm that the SPI2 is not remapped. Perhaps it's clashing with USART3 or TIM1. Check clocks on/off for those, or remap them elsewhere if appropriate. If the SPI clock is not present, consider if it is pending the TX register being loaded by DMA or a write. The reset for SPI2 (host side) is RCC->APB1RST bit 14 Dump all the RCC, GPIOB, SPI2 and AFIO registers in hex, and paste them in forum. Does it behave differently if NOT attached to a debugger?