Search found 22 matches
- Mon Dec 31, 2012 4:33 pm
- Forum: General Support
- Topic: TIM interrupt handler issue
- Replies: 6
- Views: 4788
Re: TIM interrupt handler issue
Ok little update: I discovered that program doesn't halt immediately, but after several interrupt requests. When connect the input pin to ground (= no edges to capture and no interrupts) program works. When I connect signal back to input pin the program halts within few seconds. I found that port_ha...
- Sun Dec 30, 2012 9:17 pm
- Forum: General Support
- Topic: TIM interrupt handler issue
- Replies: 6
- Views: 4788
TIM interrupt handler issue
Hello I am trying to do some specific edge capturing on CH1 of TIM2 on STM32F103C8. The problem is that when I enable interrupt (nvicEnableVector(TIM2_IRQn, 12);) execution of program ends in "port_halt" with message SV#8 - misplaced CH_IRQ_PROLOGUE(). All subsystems (ICU, GPT,...) are dis...
- Tue Nov 27, 2012 6:12 pm
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
Re: I2C Bus error handling
Ok just a little update: Error is still there, but occurs only on SDA line glitches. SCL is error prone. To reproduce error: 1) Perform continuous communication with I2C slave in loop. 2) Toggle SDA line to ground externally. 3) In around 10% cases the MCU gets stuck in I2C1_EV_IRQHandler interrupt ...
- Tue Nov 27, 2012 3:42 pm
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
Re: I2C Bus error handling
I actually don't do anything with slaves. When I introduce bus error then the current transaction fails. When MCU starts another I2C transaction the I2C slave responds normally (tested with L3G4200). Problem was on the MCU side which stopped responding being locked in I2C interrupt routine. During t...
- Fri Nov 23, 2012 8:38 pm
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
Re: I2C Bus error handling
Ok today I have done some more digging to find a problem. I was curious why the safety timer doesn't work. After some tweaking in low level driver code I gave up and restored original file. Funny thing is that since than I can't reproduce the problem anymore. No matter how I try to abuse the I2C bus...
- Fri Nov 23, 2012 11:53 am
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
Re: I2C Bus error handling
I agree that writing well working general drivers is a challenging task (thats probably why the STM32F1 I2C low level driver takes more than 1000 lines of code). But when I implement own driver I don't have to care about higher level interface and other things. That makes the task quite easier. I do...
- Tue Nov 20, 2012 9:59 pm
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
Re: I2C Bus error handling
I don't know how the low level I2C driver exactly works. So I can't offer any concrete solution. For my project I need rock solid I2C communication. Any glitch can lead to several damages. Therefor I will probably use only ChibiOS kernel and write own peripheral drivers. I think it will eventually t...
- Mon Nov 19, 2012 11:28 pm
- Forum: General Support
- Topic: I2C Bus error handling
- Replies: 13
- Views: 12553
I2C Bus error handling
Hello I am testing I2C error recovery (pulling SDA to zero externally - simulated noise) and I am using this code to read data from I2C each 500 ms: void getL3G4200GyroData(L3G4200Handle *handle, L3G4200GyroData *data){ uint8_t reg_addr = L3G4200_GYRO_DATA; msg_t msg = i2cMasterTransmitTimeout(handl...
- Sun Nov 04, 2012 10:51 pm
- Forum: General Support
- Topic: i2c hangs when reading just one byte
- Replies: 53
- Views: 23458
Re: i2c hangs when reading just one byte
The warning should definitely be at least on STM32F1xx HAL documentation http://chibios.sourceforge.net/docs/hal_stm32f1xx_rm/group___i2_c.html#ga57039ea5e6f70691b667a14248618967 and probably here http://chibios.sourceforge.net/docs/hal_stm32f1xx_rm/group___s_t_m32_f1xx___i2_c.html. 1 byte reading i...
- Sun Nov 04, 2012 9:31 pm
- Forum: General Support
- Topic: i2c hangs when reading just one byte
- Replies: 53
- Views: 23458
Re: i2c hangs when reading just one byte
Allright thanks for reply. I would definitely expect some note with big red exclamation mark in documentation. This issue is in my opinion too serious to be left undocumented. What about devices expecting only 1 byte read? Where is the problem anyway? In reference manual I clearly see the sequence f...