Reconstruct bl602 readme; move up_irq_save/restore declaration to common place
This commit is contained in:
parent
ce40edbd11
commit
7e84874cb1
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
$ ./tools/configure.sh bl602evb:nsh
|
||||
$ make -j
|
||||
|
||||
4. Setup tftp server on your laptop, copy nuttx.bin to your tftpboot directory and change its name to boot.bin
|
||||
4. Connect bl602 and computer via USB
|
||||
|
||||
5. Setup the wire connection(uart and tftp) between your board and laptop
|
||||
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.
|
||||
|
||||
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
|
||||
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.
|
||||
|
||||
7. TODO
|
||||
|
||||
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.
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#include <sched.h>
|
||||
|
||||
#include <arch/arch.h>
|
||||
#include <arch/types.h>
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
#include <nuttx/cache.h>
|
||||
|
@ -1353,6 +1354,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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue