2011-02-20 10:06 AM
2011-05-17 05:25 AM
2011-05-17 05:25 AM
0x8003ebe: 0x2000 MOVS r0, #0
0x8003ec0: 0x0004 MOVS r4, r0
SPI_CS_LOW();
0x8003ec2: 0x483b LDR.N r0, ??DataTable3_3 [0x8003fb0] ; GPIOB_BRR
0x8003ec4: 0xf44f 0x5180 MOV.W r1, #4096 ; 0x1000
0x8003ec8: 0x6001 STR r1, [r0]
cmd = sFLASH_CMD_RDSR;
0x8003eca: 0x2005 MOVS r0, #5
0x8003ecc: 0xf8ad 0x0006 STRH.W r0, [sp, #0x6]
while (!(SPI2->SR & SPI_I2S_FLAG_TXE));
??Flash_WaitForWriteEnd_2:
0x8003ed0: 0x4838 LDR.N r0, ??DataTable3_4 [0x8003fb4] ; SPI2_SR
0x8003ed2: 0x8800 LDRH r0, [r0]
0x8003ed4: 0x0780 LSLS r0, r0, #30
0x8003ed6: 0xd5fb BPL.N ??Flash_WaitForWriteEnd_2 ; 0x8003ed0
SPI2->DR = cmd;
0x8003ed8: 0x4837 LDR.N r0, ??DataTable3_5 [0x8003fb8] ; SPI2_DR
0x8003eda: 0xf8bd 0x1006 LDRH.W r1, [sp, #0x6]
0x8003ede: 0x8001 STRH r1, [r0]
while (!(SPI2->SR & SPI_I2S_FLAG_RXNE));
??Flash_WaitForWriteEnd_3:
0x8003ee0: 0x4834 LDR.N r0, ??DataTable3_4 [0x8003fb4] ; SPI2_SR
0x8003ee2: 0x8800 LDRH r0, [r0]
0x8003ee4: 0x07c0 LSLS r0, r0, #31
0x8003ee6: 0xd5fb BPL.N ??Flash_WaitForWriteEnd_3 ; 0x8003ee0
cmd = SPI2->DR;
0x8003ee8: 0x4833 LDR.N r0, ??DataTable3_5 [0x8003fb8] ; SPI2_DR
0x8003eea: 0x8800 LDRH r0, [r0]
0x8003eec: 0xf8ad 0x0006 STRH.W r0, [sp, #0x6]
data = sFLASH_DUMMY_BYTE;
??Flash_WaitForWriteEnd_4:
0x8003ef0: 0x20a5 MOVS r0, #165 ; 0xa5
0x8003ef2: 0xf8ad 0x0004 STRH.W r0, [sp, #0x4]
while (!(SPI2->SR & SPI_I2S_FLAG_TXE));
??Flash_WaitForWriteEnd_5: And, after some fails ... I got one working ... : http://img842.imageshack.us/i/works.jpg/
2011-05-17 05:25 AM
Hi,
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.2013-05-13 03:04 PM
Hi.
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.2013-05-13 04:16 PM
How are you initializing USART3?
2013-05-14 12:45 AM
It is not directly caused by USRT3 initialization
as it turned out
. I've found that SCK pin stops generating clock right after configuring pin 11 for USART3. When SPI2 works fine I do the following:GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_Init(GPIOB,&GPIO_InitStructure);
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.
2013-05-14 12:58 AM
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.
JW2013-05-20 03:32 AM
I will do it as soon as i have time.