We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
stellarisif.c
static err_t stellarisif_transmit(struct netif *netif, struct pbuf *p) { int iBuf; unsigned char *pucBuf; unsigned long *pulBuf; struct pbuf *q; int iGather; unsigned long ulGather; unsigned char *pucGather; ........................... [omitted] /* Initialze a long pointer into the pbuf for 32-bit access. */ pulBuf = (unsigned long *)&pucBuf[iBuf]; /** * Copy words of pbuf data into the Tx FIFO, but don't go past * the end of the pbuf. * */ while((iBuf + 4) <= q->len) { HWREG(ETH_BASE + MAC_O_DATA) = *pulBuf++; iBuf += 4; }
The above code is part of the latest version of the TI/Luminary StellarisWare.
I think it is a bug? And I hope to fix it with
__packed unsigned long *pulBuf;
in the KEIL toolchain. (Tested.)
But due to my very limited C programming skill, I am afraid that, I might be doing something stupid. So I would like to learn something from our experts, please kindly give me some advices.
Is that, the __packed qualifier (in this case) leads to the lower performance?
SW-RDK-S2E-6459 (part of the StellarisWare) is the latest version, which can be download from:
www.luminarymicro.com/index.php
The mentioned code triggers a Usage Fault/UNALIGNED on my LM3S6432/LM3S6911 MCUs.