Search found 6 matches

by zyp
Mon Apr 04, 2011 8:56 pm
Forum: General Support
Topic: Compiler optimization messing synchronization
Replies: 2
Views: 3716

Re: Compiler optimization messing synchronization

Use the volatile-keyword on the buffer to tell the compiler that writing the buffer has background effects.
by zyp
Sun Apr 03, 2011 3:12 pm
Forum: Development and Feedback
Topic: I2C implementation for STM32
Replies: 346
Views: 282619

Re: I2C implementation for STM32

I guess what you're doing results in unspecified behavior, which may vary between manufacturers and devices.

My workaround apparently broke your state machine, and I now have to work around that again by manually resetting it to I2C_READY before next reading.
by zyp
Sat Apr 02, 2011 8:20 pm
Forum: Development and Feedback
Topic: I2C implementation for STM32
Replies: 346
Views: 282619

Re: I2C implementation for STM32

I found the problem.

In order to generate the Stop/Re-Start condition, software must set the STOP/START bit just after reading the second last data byte (after the second last RxNE event).
(Doc ID 13902 Rev 11, page 711)

I modified i2c_lld_rxbyte to set the STOP bit at the same time as un ...
by zyp
Sat Apr 02, 2011 7:00 pm
Forum: Development and Feedback
Topic: I2C implementation for STM32
Replies: 346
Views: 282619

Re: I2C implementation for STM32

If I had a debugger, I'd done that already, but I'm still waiting for the JTAG-interface I ordered. I'm just uploading through the serial bootloader at the moment.

CH_USE_NESTED_LOCKS made no difference.

Main loop is just:
while (1) {
chThdSleepMilliseconds(1000);
}

From what I can see by ...
by zyp
Sat Apr 02, 2011 5:27 pm
Forum: Development and Feedback
Topic: I2C implementation for STM32
Replies: 346
Views: 282619

Re: I2C implementation for STM32

Update didn't change anything.

I posted relevant parts of my code here.
I'm not using any synchronization mechanisms yet, I'm only starting a single read in the main thread so there is no chance of collision.

(As for the sensors, I have one of these.)
by zyp
Fri Apr 01, 2011 10:20 pm
Forum: Development and Feedback
Topic: I2C implementation for STM32
Replies: 346
Views: 282619

Re: I2C implementation for STM32

I'm trying to use the code in the i2c_dev-branch for reading an ITG-3200 on a bus shared with BMA-150 and AK8975. However, it does not work; the system just locks up.
I'm performing the read in a similar manner to the lis3 example code, first writing one byte, then reading six bytes.

I scoped the ...