Posted on May 17, 2011 at 14:25 I have an application that I want to be able to update in the field. So I want a user friendly code to burn the new code in the device. However: this requirement came late so Ihad all the code already working, including SPI and everything. Well to be short: I did nothing to change the code, I followed the IAP example from ST, placed it in lower memory, then recompiled the original code at a different location. The IAP ( in application programming) code loads and burns the application code and JUMPS to it. That was all! I did absolutely no new effort on the old code. And there was no problem with the SPI and any other peripheral. So my idea, at your problem, is : first try to get the same code working in different locations, may be there is something that is not-relocatable and cannot work from the normal reset if not placed in the exact same position.
I come back to this topic, cause I'm facing this issue once again. Sometimes, the SCK pin of SPI2 of my STM32F102R8 does not clock, while MOSI sends correct data. What can cause the SCK pin of SPI2 not to clock ? SPI2 is not remapped, is enabled in RCC, and the pin is in ''alternate push-pull 50MHz'' mode. Only a hardware reset ( I mean powering the board down then up ) can really ''reset'' the bug, and make SPI working correctly.
It was long time ago but have you found solution to this problem? I have the same issue. My SPI2 SCK (GPIOB Pin13) simply stops clocking when i configure GPIOB Pin11 as RX for USART3. MOSI works fine but SCK is low all the time. Maybe someone knows something about this strange ''feature''. Errata doesn't say a word about it.
and SCK stops.
When I configure Pin 11 before configuring SPI2 everything works.
So for now problem is resolved but this seams to be a hardware bug or maybe I'm missing something important.
Can you please start a new thread, post a minimal but complete compilable example of code which produces the error, together with stating what device are you using.