Pan17WJ / tinyos-main

Automatically exported from code.google.com/p/tinyos-main
1 stars 0 forks source link

I2C driver for devices with USART module does not work when built with 4.x toolchain. #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reason:
I2CDR is no longer defined in the TI headers used by the 4.x toolchains. In the
3.2.3 header files there is a comment stating that I2CDR is deprecated and
I2CDRB should be used instead. However, this never propagated into tinyos files.

If I2CDR is used data will never be written to the I2C data register but to
some memory location in RAM and the I2C bus falls silent after
transmitting the slave address.

An object dump shows that I2CDR_ is located in the .bss section. __I2CDRB is 
located at the correct register address 0x76.

msp430-objdump -t main.exe gives:

SYMBOL TABLE:
...
0000111a l     O .bss   00000001 I2CDR_

00000076 g       *ABS*  00000000 __I2CDRW

00000076 g       *ABS*  00000000 __I2CDRB
...

and the corresponding app.c snippet:

#49 "/opt/tinyos2/tos/chips/msp430/usart/HplMsp430I2C0P.nc"
static volatile uint8_t HplMsp430I2C0P__U0CTL __asm ("0x0070");
static volatile uint8_t HplMsp430I2C0P__I2CTCTL __asm ("0x0071");

static volatile uint8_t HplMsp430I2C0P__I2CDR __asm ("I2CDR_"); // <- this goes 
to .bss section

static volatile uint16_t HplMsp430I2C0P__I2CSA __asm ("0x011A");
static volatile uint8_t HplMsp430I2C0P__I2CIE __asm ("0x0050");

Affected files:

I2C driver in tos/msp430/usart

Thread on tinyos-devel mailing list:
https://www.millennium.berkeley.edu/pipermail/tinyos-devel/2012-October/005187.h
tml

Jonas

Original issue reported on code.google.com by jns.neba...@gmail.com on 9 Oct 2012 at 7:35

GoogleCodeExporter commented 9 years ago

Original comment by vlado.handziski on 9 Oct 2012 at 8:07

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r6019.

Original comment by vlado.handziski on 18 Oct 2012 at 6:52