You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by bt...@apache.org on 2020/12/29 09:52:24 UTC

[incubator-nuttx] 04/09: Reconstruct bl602 readme; move up_irq_save/restore declaration to common place

This is an automated email from the ASF dual-hosted git repository.

btashton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7e84874cb15ca36124febc4f77131b13a22bf87f
Author: Virus.V <vi...@live.com>
AuthorDate: Fri Dec 18 23:06:41 2020 +0800

    Reconstruct bl602 readme; move up_irq_save/restore declaration to common place
---
 arch/risc-v/include/bl602/irq.h         |  2 --
 arch/risc-v/src/bl602/bl602_lowputc.c   |  3 ---
 boards/risc-v/bl602/bl602evb/README.txt | 28 +++++++++++++--------------
 include/nuttx/arch.h                    | 34 +++++++++++++++++++++++++++++++++
 4 files changed, 48 insertions(+), 19 deletions(-)

diff --git a/arch/risc-v/include/bl602/irq.h b/arch/risc-v/include/bl602/irq.h
index 8a3f562..aef5664 100644
--- a/arch/risc-v/include/bl602/irq.h
+++ b/arch/risc-v/include/bl602/irq.h
@@ -224,8 +224,6 @@ extern "C"
  * Public Function Prototypes
  ****************************************************************************/
 
-EXTERN irqstate_t up_irq_save(void);
-EXTERN void       up_irq_restore(irqstate_t);
 EXTERN irqstate_t up_irq_enable(void);
 
 #undef EXTERN
diff --git a/arch/risc-v/src/bl602/bl602_lowputc.c b/arch/risc-v/src/bl602/bl602_lowputc.c
index 8305cbf..6e66b6b 100644
--- a/arch/risc-v/src/bl602/bl602_lowputc.c
+++ b/arch/risc-v/src/bl602/bl602_lowputc.c
@@ -426,9 +426,6 @@ void bl602_lowsetup(void)
 
   bl602_uart_configure(BL602_CONSOLE_BASE, &g_bl602_console_config);
 
-  up_lowputc('A');
-  up_lowputc('\r');
-  up_lowputc('\n');
 #endif /* HAVE_SERIAL_CONSOLE */
 }
 
diff --git a/boards/risc-v/bl602/bl602evb/README.txt b/boards/risc-v/bl602/bl602evb/README.txt
index e7bd857..5fd2e7b 100644
--- a/boards/risc-v/bl602/bl602evb/README.txt
+++ b/boards/risc-v/bl602/bl602evb/README.txt
@@ -2,27 +2,27 @@
 
   $ curl https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
 
-2. Follow instruction on https://github.com/enjoy-digital/litex to build the vexriscv softcore fpga gateware
-   and flash to arty_a7 board
+2. Download Bouffalo lab flash tools
+
+  $ git clone https://github.com/bouffalo/flash_tools.git
 
 3. Configure and build NuttX
 
   $ mkdir ./nuttx; cd ./nuttx
-  $ git clone https://bitbucket.org/nuttx/nuttx.git
-  $ git clone https://bitbucket.org/nuttx/apps.git
+  $ git clone https://github.com/apache/incubator-nuttx.git nuttx
+  $ git clone https://github.com/apache/incubator-nuttx-apps.git apps
   $ cd nuttx
   $ make distclean
-  $ ./tools/configure.sh arty_a7:nsh
-  $ make V=1
-
-4. Setup tftp server on your laptop, copy nuttx.bin to your tftpboot directory and change its name to boot.bin
+  $ ./tools/configure.sh bl602evb:nsh
+  $ make -j
 
-5. Setup the wire connection(uart and tftp) between your board and laptop
+4. Connect bl602 and computer via USB
 
-6. Run  $ minicom -b 1000000 /dev/ttyUSB1 (the default baudrate on litex vexriscv is 1e6)
-   when you see the bios prompt "litex>", type "netboot" and enter soon comes the nsh prompt
+5. Run flash tools, select the nuttx.bin generated in the previous step in the
+   Firmware bin field, and refer to the document for the settings of the remaining fields.
+   Click the download button to download bin to bl602.
 
-7. TODO
+6. Run  $ picocom -b 115200 /dev/ttyUSB0 (If you see garbled characters at the begining, it is because 
+   boot2 outputs some log at 2M baud rate), then you will see "nuttx>" prompt.
 
-  Support GPIO/SPI/I2C/RTC/WDT/PWM
-  Support RISC-V User mode
+How to download to bl602 can refer to the docs in the https://github.com/bouffalolab/bl_iot_sdk repository.
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 31cd3b0..328f593 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -81,6 +81,7 @@
 #include <sched.h>
 
 #include <arch/arch.h>
+#include <arch/types.h>
 
 #include <nuttx/compiler.h>
 #include <nuttx/cache.h>
@@ -1354,6 +1355,39 @@ void up_irqinitialize(void);
 bool up_interrupt_context(void);
 
 /****************************************************************************
+ * Name: up_irq_save
+ *
+ * Description:
+ *   Save the current interrupt state and disable interrupts.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   Interrupt state prior to disabling interrupts.
+ *
+ ****************************************************************************/
+
+irqstate_t up_irq_save(void);
+
+/****************************************************************************
+ * Name: up_irq_restore
+ *
+ * Description:
+ *   Restore the previous irq state (i.e., the one previously
+ *   returned by up_irq_save())
+ *
+ * Input Parameters:
+ *   irqstate - The interrupt state to be restored.
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void up_irq_restore(irqstate_t irqstate);
+
+/****************************************************************************
  * Name: up_enable_irq
  *
  * Description: