Search found 19 matches

by BreederBai
Wed Sep 19, 2018 2:29 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

Hi,

The check is correct, there is a silicon bug on F1s that make it impossible to transfer one byte using DMA.

Giovanni
After deleting "osalDbgCheck((rxbytes == 0) || ((rxbytes > 1) && (rxbuf != NULL)))"), I tried to read a byte and no exception occurred. The DMA bug looks very Surprising ...
by BreederBai
Wed Sep 19, 2018 2:07 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

Giovanni wrote:Hi,

The check is correct, there is a silicon bug on F1s that make it impossible to transfer one byte using DMA.

Giovanni

Is it impossible for all DMAs to transfer 1 byte? Does this mean that I2C cannot read or write 1 byte? What should I do if I want to read and write a byte?
by BreederBai
Tue Sep 18, 2018 9:52 am
Forum: STM32 Support
Topic: L432KC i2cMasterTransmit freezes
Replies: 9
Views: 9417

Re: L432KC i2cMasterTransmit freezes

I'm having some hard time trying to run I2C transactions with a STM32L432KC, from the first call I do to i2cMasterTransmit the application seems to freeze, nothing seems to run at the thread level and there aren't any assertions have debug checks enabled.
Before I proceed I'd like to point out that ...
by BreederBai
Tue Sep 18, 2018 9:48 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

Exactly what would be the modified code?

Giovanni
I think the I2C driver has a bug.Below is the original code,When reading a byte," osalDbgCheck((rxbytes == 0) || ((rxbytes > 1) && (rxbuf != NULL)));"Will report an error and block the current thread.
msg_t i2c_lld_master_transmit_timeout ...
by BreederBai
Tue Sep 18, 2018 9:41 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

Exactly what would be the modified code?

Giovanni
I may have solved this problem. I added i2cStart(&I2C,&I2CCfg) before calling i2cMasterTransmitTimeout to solve the thread blocking problem.
template <unsigned RxSize>
std&#58;&#58;array<uint8_t, RxSize> read(const std&#58;&#58;uint8_t first_reg ...
by BreederBai
Tue Sep 18, 2018 3:23 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

On F1 (GPIOv1) there are no alternate numbers, just alternate or not.

The driver is very old and proved to work, probably the problem is not where you are looking, I would bet on some HW issue (because bus locked).

Giovanni

I modified the following code
msg_t i2c_lld_master_transmit_timeout ...
by BreederBai
Tue Sep 18, 2018 3:09 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

On F1 (GPIOv1) there are no alternate numbers, just alternate or not.

The driver is very old and proved to work, probably the problem is not where you are looking, I would bet on some HW issue (because bus locked).

Giovanni

After debugging, I found that the system restarts should be related to ...
by BreederBai
Mon Sep 17, 2018 7:14 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

I found a strange phenomenon,When I commented the code like this.Calling the i2cMasterTransmitTimeout function will still restart.
msg_t i2c_lld_master_transmit_timeout(I2CDriver *i2cp, i2caddr_t addr,
const uint8_t *txbuf, size_t txbytes,
uint8_t *rxbuf, size_t rxbytes,
systime_t timeout ...
by BreederBai
Tue Sep 11, 2018 2:27 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

steved wrote:Check that you have sufficient stack allocated to the task that reads the I2c.

(If you use ChibiStudio, in includes a plugin that can show you stack usage)


I am using ”make“ compiled ChibiOS, may I ask how to increase the I2C stack in this case
by BreederBai
Tue Sep 11, 2018 2:05 am
Forum: ChibiOS/HAL
Topic: I2C err
Replies: 26
Views: 17188

Re: I2C err

From the message "i2c_lld_master_transmit_timeout" you could find the possible cause in the source code.

My guess is your peripheral is not correctly receiving, and it is not answering the read/write request => timout.

The peripheral address could be also wrong. Check if the address is not ...