This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C with Keil RTX doesn't work

Hi

When I use I2C library without Keil RTX to communicate with I2C EEPROM the program works fine, but when I start the RTX the program stuck at:

while(!Status) Status=I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED); // Test on EV6 and clear it

Somebody know how to fix this?

Ps: uVision3 V3.63 , MDK-ARM V3.24 , RL-ARM V3.40

Parents
  • First of all,thanks you all for help.
    This is not the problem, my init function call the self kill procedure.
    All the RTX are working.
    My code have only one task, and inside it I call a test function that write 10 address at EEPROM and read the same address after.

    Reading the datasheet, I saw a bit that reset the I2C thru sowftware (bit 15 of CR1 of STM32F103RB). Setting this bit force the I2C to go to reset state, cleaning it put the I2C in ready state. So I tried to reset and reconfigure the I2C before every write/read action, and it works. The problem was solved thought I ! But how not everything is a sea of roses, I dont know why the interrupt of USART stopped work.
    So the problem still unsolved.

Reply
  • First of all,thanks you all for help.
    This is not the problem, my init function call the self kill procedure.
    All the RTX are working.
    My code have only one task, and inside it I call a test function that write 10 address at EEPROM and read the same address after.

    Reading the datasheet, I saw a bit that reset the I2C thru sowftware (bit 15 of CR1 of STM32F103RB). Setting this bit force the I2C to go to reset state, cleaning it put the I2C in ready state. So I tried to reset and reconfigure the I2C before every write/read action, and it works. The problem was solved thought I ! But how not everything is a sea of roses, I dont know why the interrupt of USART stopped work.
    So the problem still unsolved.

Children