OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [docs/] [userguide/] [executable_upload.adoc] - Blame information for rev 72

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 69 zero_gravi
<<<
2
:sectnums:
3
== Uploading and Starting of a Binary Executable Image via UART
4
 
5
Follow this guide to use the bootloader to upload an executable via UART.
6
 
7
[NOTE]
8
This concept uses the default "Indirect Boot" scenario that uses the bootloader to upload new executables.
9
See datasheet section https://stnolting.github.io/neorv32/#_indirect_boot[Indirect Boot] for more information.
10
 
11
[IMPORTANT]
12
If your FPGA board does not provide such an interface - don't worry!
13
Section <<_installing_an_executable_directly_into_memory>> shows how to
14
run custom programs on your FPGA setup without having a UART.
15
 
16
[start=1]
17
. Connect the primary UART (UART0) interface of your FPGA board to a serial port of your host computer.
18
. Start a terminal program. In this tutorial, I am using TeraTerm for Windows. You can download it for free
19 72 zero_gravi
from https://ttssh2.osdn.jp/index.html.en . On Linux you could use `cutecom` (recommended) or `GTKTerm`,
20
which you can get here https://github.com/Jeija/gtkterm.git (or install via your package manager).
21 69 zero_gravi
 
22 70 zero_gravi
[IMPORTANT]
23 69 zero_gravi
_Any_ terminal program that can connect to a serial port should work. However, make sure the program
24 70 zero_gravi
can transfer data in _raw_ byte mode without any protocol overhead around it. Some terminal programs struggle with
25
transmitting files larger than 4kB (see https://github.com/stnolting/neorv32/pull/215). Try a different program
26
if uploading a binary does not work (terminal stall).
27 69 zero_gravi
 
28
[start=3]
29
. Open a connection to the the serial port your UART is connected to. Configure the terminal setting according to the
30
following parameters:
31
 
32
* 19200 Baud
33
* 8 data bits
34
* 1 stop bit
35
* no parity bits
36
* _no_ transmission/flow control protocol
37
* receiver (host computer) newline on `\r\n` (carriage return & newline)
38
 
39
[start=4]
40
. Also make sure that single chars are send from your computer _without_ any consecutive "new line" or "carriage
41
return" commands (this is highly dependent on your terminal application of choice, TeraTerm only
42
sends the raw chars by default).
43
. Press the NEORV32 reset button to restart the bootloader. The status LED starts blinking and the
44
bootloader intro screen appears in your console. Hurry up and press any key (hit space!) to abort the
45
automatic boot sequence and to start the actual bootloader user interface console.
46
 
47
.Bootloader console; aborted auto-boot sequence
48
[source,bash]
49
----
50
<< NEORV32 Bootloader >>
51
 
52 72 zero_gravi
BLDV: Feb 16 2022
53
HWV:  0x01060709
54
CLK:  0x05f5e100
55
ISA:  0x40901107 + 0xc000068b
56
SOC:  0x7b7f402f
57
IMEM: 0x00008000 bytes @0x00000000
58
DMEM: 0x00004000 bytes @0x80000000
59 69 zero_gravi
 
60 72 zero_gravi
Autoboot in 8s. Press any key to abort.
61 69 zero_gravi
Aborted.
62
 
63
Available commands:
64 72 zero_gravi
 h: Help
65
 r: Restart
66
 u: Upload
67
 s: Store to flash
68
 l: Load from flash
69
 e: Execute
70 69 zero_gravi
CMD:>
71
----
72
 
73
[start=6]
74
. Execute the "Upload" command by typing `u`. Now the bootloader is waiting for a binary executable to be send.
75
 
76
[source,bash]
77
----
78
CMD:> u
79
Awaiting neorv32_exe.bin...
80
----
81
 
82
[start=7]
83
. Use the "send file" option of your terminal program to send a NEORV32 executable (`neorv32_exe.bin`).
84
. Again, make sure to transmit the executable in raw binary mode (no transfer protocol).
85
When using TeraTerm, select the "binary" option in the send file dialog.
86
. If everything went fine, OK will appear in your terminal:
87
 
88
[source,bash]
89
----
90
CMD:> u
91
Awaiting neorv32_exe.bin... OK
92
----
93
 
94
[start=10]
95
. The executable is now in the instruction memory of the processor. To execute the program right
96
now run the "Execute" command by typing `e`:
97
 
98
[source,bash]
99
----
100
CMD:> u
101
Awaiting neorv32_exe.bin... OK
102
CMD:> e
103
Booting...
104
Blinking LED demo program
105
----
106
 
107
[start=11]
108
. If everything went fine, you should see the LEDs blinking.
109
 
110
[NOTE]
111
The bootloader will print error codes if something went wrong.
112
See section https://stnolting.github.io/neorv32/#_bootloader[Bootloader] of the NEORV32 datasheet for more information.
113
 
114
[TIP]
115
See section <<_programming_an_external_spi_flash_via_the_bootloader>> to learn how to use an external SPI
116
flash for nonvolatile program storage.
117
 
118
[TIP]
119
Executables can also be uploaded via the **on-chip debugger**.
120
See section <<_debugging_with_gdb>> for more information.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.