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 | |
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')
-rw-r--r-- | nuttx/arch/arm/src/samv7/sam_emac.c | 11 | ||||
-rw-r--r-- | nuttx/configs/samv71-xult/README.txt | 8 | ||||
-rw-r--r-- | nuttx/configs/samv71-xult/netnsh/defconfig | 6 |
3 files changed, 16 insertions, 9 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; diff --git a/nuttx/configs/samv71-xult/README.txt b/nuttx/configs/samv71-xult/README.txt index d4bd5b1da..ba8526706 100644 --- a/nuttx/configs/samv71-xult/README.txt +++ b/nuttx/configs/samv71-xult/README.txt @@ -49,7 +49,7 @@ Board Features - Embedded Debugger with Data Gateway Interface and Virtual COM port (CDC) - External power input (5-14V) or USB powered -See the Atmel webite for further information about this board: +See the Atmel website for further information about this board: - http://www.atmel.com/tools/atsamv71-xult.aspx @@ -475,6 +475,7 @@ Selecting the GMAC peripheral Networking Support CONFIG_NET=y : Enable Neworking + CONFIG_NET_NOINTS=y : Use the work queue, not interrupts for processing CONFIG_NET_SOCKOPTS=y : Enable socket operations CONFIG_NET_ETH_MTU=562 : Maximum packet size (MTU) 1518 is more standard CONFIG_NET_ETH_TCP_RECVWNDO=562 : Should be the same as CONFIG_NET_ETH_MTU @@ -801,7 +802,7 @@ Configuration sub-directories long, perhaps minutes, if the network cable is not connected! If fast boot times are required, you need to perform asynchronous - network initializatino as described about under "Network Initialization + network initialization as described about under "Network Initialization Thread" 5. SDRAM is NOT enabled in this configuration. @@ -824,7 +825,7 @@ Configuration sub-directories 7. TWIHS0 is used to support 256 byte non-volatile storage. This EEPROM holds the assigned MAC address which is necessary for networking. The - EEPROM is also avaiable for storage of configuration data using the + EEPROM is also available for storage of configuration data using the MTD configuration as described above under the heading, "MTD Configuration Data". @@ -1048,4 +1049,3 @@ Configuration sub-directories Stack sizes are also large to simplify the bring-up and should be tuned for better memory usages. - diff --git a/nuttx/configs/samv71-xult/netnsh/defconfig b/nuttx/configs/samv71-xult/netnsh/defconfig index e4cf9aae9..31f55bb9a 100644 --- a/nuttx/configs/samv71-xult/netnsh/defconfig +++ b/nuttx/configs/samv71-xult/netnsh/defconfig @@ -51,9 +51,9 @@ CONFIG_ARCH_HAVE_STACKCHECK=y # CONFIG_STACK_COLORATION is not set # CONFIG_DEBUG_SYMBOLS is not set CONFIG_ARCH_HAVE_CUSTOMOPT=y -CONFIG_DEBUG_NOOPT=y +# CONFIG_DEBUG_NOOPT is not set # CONFIG_DEBUG_CUSTOMOPT is not set -# CONFIG_DEBUG_FULLOPT is not set +CONFIG_DEBUG_FULLOPT=y # # System Type @@ -647,7 +647,7 @@ CONFIG_UART3_2STOP=0 CONFIG_ARCH_HAVE_NET=y CONFIG_ARCH_HAVE_PHY=y CONFIG_NET=y -# CONFIG_NET_NOINTS is not set +CONFIG_NET_NOINTS=y # CONFIG_NET_PROMISCUOUS is not set # |