AnsweredAssumed Answered

Program stm32F072 from Bootloader I2C

Question asked by alessio mariucci on Jun 5, 2018

hello everybodys , i'm trying to program stm32f072 from stm's bootloader through i2c interface. the stm32f072 is the slave board while the another MCU is the Host/Master board.  The host Board use the Simulate i2c on the 2 GPIO connected to SDA and SCL in the stm32f072. I' have a problem. the slave board return always 0x00 when i try to send bootloader's command.  What's the correct i2c sequence to be sent from master to slave ? I use for example this sequence: 

 

Master board : 

 

I2C_Start_Bit();
Send_Byte(0X77); //Address slave 0x3B + 1 bit write 
ACK();
Send_Byte(0X00); //command bootloader 
ACK();
Send_Byte(0xFF); //command bootloader 
ACK();
data[0] = Read_Byte(); //return 0x00 from slave 
ACK();
data[1] = Read_Byte(); //return 0x00 from slave 
ACK();
data[2] = Read_Byte(); //return 0x00 from slave
NACK();
I2C_Stop_Bit();

 

i tried to change read/write bit at top, but nothing. 

i tried use different combination sequence  but nothing. 

 

the ACK return from the slave is correct ! 

 

I set the Boot0 pin 1 and nBot0 bit at 1 

the level protection is 0 

 

why cannot i read the correct returned command ? 

the function are correct because i'm monitoring them through logic analyzer level. 

 

thank you all and sorry for the bad english

Outcomes