diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-28 09:42:45 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-28 09:42:45 -0600 |
commit | 4bb4635f843d543098228a4a73e121c131618426 (patch) | |
tree | 0e7daf6c415b183f04d91ef4f7defe5e427fc6c6 /nuttx/arch | |
parent | e9463b9ed8d7708763ce5265a382430db5a056d0 (diff) | |
download | px4-nuttx-4bb4635f843d543098228a4a73e121c131618426.tar.gz px4-nuttx-4bb4635f843d543098228a4a73e121c131618426.tar.bz2 px4-nuttx-4bb4635f843d543098228a4a73e121c131618426.zip |
SAMV7 EMAC: Sometimes TX is not started when TSTART is set??? Workaround seems to be to set it twice. Restored full optimization. Also CONFIG_NET_NOINTS is set so that interrupt level provessing is avoided
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/arm/src/samv7/sam_emac.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/samv7/sam_emac.c b/nuttx/arch/arm/src/samv7/sam_emac.c index b173fd829..97d685ada 100644 --- a/nuttx/arch/arm/src/samv7/sam_emac.c +++ b/nuttx/arch/arm/src/samv7/sam_emac.c @@ -1318,7 +1318,7 @@ static int sam_transmit(struct sam_emac_s *priv, int qid) (uintptr_t)txdesc->addr + dev->d_len); } - /* Update TX descriptor status. */ + /* Update TX descriptor status (with USED=0). */ status = dev->d_len | EMACTXD_STA_LAST; if (txhead == priv->xfrq[qid].ntxbuffers - 1) @@ -1347,6 +1347,13 @@ static int sam_transmit(struct sam_emac_s *priv, int qid) regval |= EMAC_NCR_TSTART; sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval); + /* REVISIT: Sometimes TSTART is missed? In this case, the symptom is + * that the packet is not sent until the next transfer when TXSTART + * is set again. + */ + + sam_putreg(priv, SAM_EMAC_NCR_OFFSET, regval); + /* Setup the TX timeout watchdog (perhaps restarting the timer) */ (void)wd_start(priv->txtimeout, SAM_TXTIMEOUT, sam_txtimeout_expiry, 1, @@ -1515,7 +1522,7 @@ static void sam_dopoll(struct sam_emac_s *priv, int qid) static int sam_recvframe(struct sam_emac_s *priv, int qid) { - struct emac_rxdesc_s *rxdesc; + volatile struct emac_rxdesc_s *rxdesc; struct net_driver_s *dev; const uint8_t *src; uint8_t *dest; |