2017-05-22 02:05 AM
Hello,
I'm working on a project in which there is an inter-board I2C link between the master MSP430F5438A and the slave STM32F207IG. Now whenever the master MSP430 resets(due to the external watchdog), the PE bit (Peripheral Enable bit) present in the I2C control register of STM32F2 is set to zero. This reset of the PE bit causes a deinitialisation of the I2C link. Any idea why the PE bit changes?
2017-05-22 05:07 AM
According to RM, PE bit is not cleared by hardware, so it's the software which clears it.
JW
2017-05-24 12:10 AM
Okay, I'm running Micrium 3 OS on MSP430. The PE bit does not reset when Micrium is not running on MSP, the reset occurs only when Micrium runs on MSP.Is it possible that the RTOS is a cause for the reseting of the PE bit? If yes HOW and WHY?
2017-05-24 01:58 AM
I know nothing of this OS. Does the OS actually handle the I2C directly? If not, it's unlikely it will write to a hardware register, so it's influence is indirect/coincidental.
In debugger, you can set a data breakpoint upon write to the I2C control register, try to start in that direction, although it may be a dead-end if that register is written too often in normal operation. You can also investigate which parts of your code (or any 'library' included) writes to the control register. There's still a possibility of a runaway pointer, but it also sounds quite unlikely given the IO space is relatively far from any memory space.
JW