mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
Squashed commit of the following:
arch/arm/src/max326xx/max32660/max32660_clockconfig.c: Fix an error in a register name.
arm/src/max326xx/max32660: Fix a few new compilation errors when DEBUG is enabled.
This commit is contained in:
@@ -155,7 +155,7 @@ static void max326_enable_hfio(FAR const struct clock_setup_s *clksetup)
|
|||||||
|
|
||||||
/* Wait for the oscillator to become ready */
|
/* Wait for the oscillator to become ready */
|
||||||
|
|
||||||
while ((getreg32(GCR_CLKCTRL_HIRCRDY) & GCR_CLKCTRL_HIRCRDY) == 0)
|
while ((getreg32(MAX326_GCR_CLKCTRL) & GCR_CLKCTRL_HIRCRDY) == 0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,10 +343,6 @@ void max326_uart_configure(uintptr_t base,
|
|||||||
ctrl0 |= UART_CTRL0_TOCNT(4);
|
ctrl0 |= UART_CTRL0_TOCNT(4);
|
||||||
putreg32(ctrl0, base + MAX326_UART_CTRL0_OFFSET);
|
putreg32(ctrl0, base + MAX326_UART_CTRL0_OFFSET);
|
||||||
|
|
||||||
/* Enable trigger events */
|
|
||||||
|
|
||||||
DEBUGASSERT(config->)
|
|
||||||
|
|
||||||
/* Setup configuration and enable UART */
|
/* Setup configuration and enable UART */
|
||||||
|
|
||||||
ctrl0 &= ~UART_CTRL0_SIZE_MASK;
|
ctrl0 &= ~UART_CTRL0_SIZE_MASK;
|
||||||
|
|||||||
@@ -126,6 +126,12 @@
|
|||||||
#define UART_INT_RXERRORS (UART_INT_FRAME | UART_INT_PARITY | \
|
#define UART_INT_RXERRORS (UART_INT_FRAME | UART_INT_PARITY | \
|
||||||
UART_INT_RXOVR)
|
UART_INT_RXOVR)
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_FEATURES
|
||||||
|
# define UART_INT_ALL (UART_INT_TX | UART_INT_RX | UART_INT_RXERRORS)
|
||||||
|
#else
|
||||||
|
# define UART_INT_ALL (UART_INT_TX | UART_INT_RX)
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -519,7 +525,8 @@ static int max326_interrupt(int irq, void *context, FAR void *arg)
|
|||||||
/* Read and clear FIFO interrupt status */
|
/* Read and clear FIFO interrupt status */
|
||||||
|
|
||||||
regval = max326_serialin(priv, MAX326_UART_STAT_OFFSET);
|
regval = max326_serialin(priv, MAX326_UART_STAT_OFFSET);
|
||||||
max326_serialout(priv, MAX326_UART_STAT_OFFSET, regval);
|
max326_serialout(priv, MAX326_UART_STAT_OFFSET,
|
||||||
|
regval & UART_INT_ALL);
|
||||||
|
|
||||||
/* Handle incoming, receive bytes.
|
/* Handle incoming, receive bytes.
|
||||||
* Check if the received FIFO is not empty.
|
* Check if the received FIFO is not empty.
|
||||||
@@ -548,10 +555,11 @@ static int max326_interrupt(int irq, void *context, FAR void *arg)
|
|||||||
#ifdef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_FEATURES
|
||||||
/* Check for RX error conditions */
|
/* Check for RX error conditions */
|
||||||
|
|
||||||
if ((regval & MAX326_INT_RXERRORS) != 0)
|
if ((regval & UART_INT_RXERRORS) != 0)
|
||||||
{
|
{
|
||||||
/* And now do... what? Should we reset FIFOs on a FIFO error? */
|
/* And now do... what? Should we reset FIFOs on a FIFO error? */
|
||||||
#warning Misssing logic
|
#warning Misssing logic
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ Buttons
|
|||||||
OpenOCD
|
OpenOCD
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
Starting OpenOCD
|
||||||
|
----------------
|
||||||
|
|
||||||
An Eclipse based toolchain is available for download from Maxim Integrated.
|
An Eclipse based toolchain is available for download from Maxim Integrated.
|
||||||
If you (like me) are not an IDE user then the good news is the OpenOCD for
|
If you (like me) are not an IDE user then the good news is the OpenOCD for
|
||||||
the MAX32660 is available within that toolchain.
|
the MAX32660 is available within that toolchain.
|
||||||
@@ -110,4 +113,29 @@ OpenOCD
|
|||||||
IFCFG="C:\Maxim\Toolchain\share\openocd\scripts\interface\max32660_hdk.cfg"
|
IFCFG="C:\Maxim\Toolchain\share\openocd\scripts\interface\max32660_hdk.cfg"
|
||||||
MCUCFG="C:\Maxim\Toolchain\share\openocd\scripts\target\max32660.cfg"
|
MCUCFG="C:\Maxim\Toolchain\share\openocd\scripts\target\max32660.cfg"
|
||||||
|
|
||||||
${OPENOCD} -f ${IFCFG} -f ${MCUCFG}
|
${OPENOCD} ${1} -f ${IFCFG} # -f ${MCUCFG}
|
||||||
|
|
||||||
|
Loading Code:
|
||||||
|
|
||||||
|
Code can be loaded into FLASH using the convenient ARM MBED drag'n'drop
|
||||||
|
interface. Or it can be loaded using GDB as follows:
|
||||||
|
|
||||||
|
$ arm-none-eabi-gdb
|
||||||
|
(gdb) target remote localhost:3333
|
||||||
|
(gdb) mon reset
|
||||||
|
(gdb) mon halt
|
||||||
|
(gdb) load nuttx
|
||||||
|
|
||||||
|
This does not work so reliably for me, however.
|
||||||
|
|
||||||
|
Debugging:
|
||||||
|
|
||||||
|
$ arm-none-eabi-gdb
|
||||||
|
(gdb) target remote localhost:3333
|
||||||
|
(gdb) mon reset
|
||||||
|
(gdb) mon reg pc 0x11c
|
||||||
|
(gdb) file nuttx
|
||||||
|
(gdb) b os_start
|
||||||
|
(gdb) c
|
||||||
|
|
||||||
|
Also not very reliable.
|
||||||
|
|||||||
Reference in New Issue
Block a user