summaryrefslogtreecommitdiff
path: root/nuttx/configs/maple/README.txt
blob: 53d8c6c2129af5c719a79982b3dd18be676c0b2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
README
======

This README discusses issues unique to NuttX configurations for the
maple board from LeafLabs (http://leaflabs.com).

Microprocessor: 32-bit ARM Cortex M3 at 72MHz STM32F103RBT6 (STM32F103CBT6 for mini version)
Memory:         120 KB Flash and 20 KB SRAM
I/O Pins Out:   43 (34 for mini version)
ADCs:           9 (at 12-bit resolution)
Peripherals:    4 timers, 2 I2Cs, 2 SPI ports, 3 USARTs
Other:          Sleep, stop, and standby modes; serial wire debug and JTAG interfaces

Please see below link for a list of maple devices and documentations.

    http://leaflabs.com/devices
    http://leaflabs.com/docs

This config supports Maple and Maple Mini.

Contents
========

  - Development Environment
  - DFU
  - Configurations

Development Environment
=======================

  Either Linux (recommended), Mac or Cygwin on Windows can be used for the development environment.
  The source has been built only using the GNU toolchain (see below).  Other
  toolchains will likely cause problems. Testing was performed using the Cygwin
  environment because the Raisonance R-Link emulatator and some RIDE7 development tools
  were used and those tools works only under Windows.

DFU
===

  The linker files in these projects can be configured to indicate that you
  will be loading code using STMicro built-in USB Device Firmware Upgrade (DFU)
  loader or via some JTAG emulator.  You can specify the DFU bootloader by
  adding the following line:

    CONFIG_STM32_DFU=y

  to your .config file. Most of the configurations in this directory are set
  up to use the DFU loader.

  If CONFIG_STM32_DFU is defined, the code will not be positioned at the beginning
  of FLASH (0x08000000) but will be offset to 0x08005000.  This offset is needed
  to make space for the DFU loader and 0x08005000 is where the DFU loader expects
  to find new applications at boot time.  If you need to change that origin for some
  other bootloader, you will need to edit the file(s) ld.script.dfu for each
  configuration. In LeafLabs case, we are using maple bootloader:

      http://leaflabs.com/docs/bootloader.html

  For Linux or Mac:
  ----------------

  While on Linux or Mac, we can use dfu-util to upload nuttx binary.

  1. Make sure we have installed dfu-util. (From yum, apt-get or build from source.)
  2. Start the DFU loader (bootloader) on the maple board. You do this by
     resetting the board while holding the "Key" button. Windows should
     recognize that the DFU loader has been installed.
  3. Flash the nuttx.bin to the board use dfu-util. Here's an example:

      $ dfu-util -a1 -d 1eaf:0003 -D nuttx.bin -R

  For anything not clear, we can refer to LeafLabs official document:

    http://leaflabs.com/docs/unix-toolchain.html

  For Windows:
  -----------

  The DFU SE PC-based software is available from the STMicro website,
  http://www.st.com.  General usage instructions:

  1. Connect the maple board to your computer using a USB
     cable.
  2. Start the DFU loader on the maple board. You do this by
     resetting the board while holding the "Key" button. Windows should
     recognize that the DFU loader has been installed.
  3. Run the DFU SE program to load nuttx.bin into FLASH.

  What if the DFU loader is not in FLASH? The loader code is available
  inside of the Demo dirctory of the USBLib ZIP file that can be downloaded
  from the STMicro Website. You can build it using RIDE (or other toolchains);
  you will need a JTAG emulator to burn it into FLASH the first time.

  In order to use STMicro's built-in DFU loader, you will have to get
  the NuttX binary into a special format with a .dfu extension. The
  DFU SE PC_based software installation includes a file "DFU File Manager"
  conversion program that a file in Intel Hex format to the special DFU
  format. When you successfully build NuttX, you will find a file called
  nutt.hex in the top-level directory. That is the file that you should
  provide to the DFU File Manager. You will end up with a file called
  nuttx.dfu that you can use with the STMicro DFU SE program.

Configurations
==============

  Information Common to All Configurations
  ----------------------------------------
  Each Maple configuration is maintained in a sub-directory and
  can be selected as follow:

    cd tools
    ./configure.sh maple/<subdir>
    cd -
    . ./setenv.sh

  Before sourcing the setenv.sh file above, you should examine it and perform
  edits as necessary so that TOOLCHAIN_BIN is the correct path to the directory
  than holds your toolchain binaries.

  And then build NuttX by simply typing the following.  At the conclusion of
  the make, the nuttx binary will reside in an ELF file called, simply, nuttx.

    make

  The <subdir> that is provided above as an argument to the tools/configure.sh
  must be is one of the following.

  NOTES:

  1. These configurations use the mconf-based configuration tool.  To
    change any of these configurations using that tool, you should:

    a. Build and install the kconfig-mconf tool.  See nuttx/README.txt
       and misc/tools/

    b. Execute 'make menuconfig' in nuttx/ in order to start the
       reconfiguration process.

  Configuration Sub-directories
  -----------------------------

  nsh:

    This configuration directory provide the basic NuttShell (NSH).
    A serial console is provided on USART1.

    NOTES:
    1. Currently configured for the STM32F103CB.  But this is easily
       reconfigured:

       CONFIG_ARCH_CHIP_STM32F103RB=n
       CONFIG_ARCH_CHIP_STM32F103CB=y

    2. Support for the I2C tool has been disabled, but can be restored
       with following configure options:

       System Type -> Peripherals
         CONFIG_STM32_I2C1=y
         CONFIG_STM32_I2C2=y
         CONFIG_STM32_I2CTIMEOSEC=1
         CONFIG_STM32_I2CTIMEOMS=500
         CONFIG_STM32_I2CTIMEOTICKS=500

       Drivers
        CONFIG_I2C=y
        CONFIG_I2C_TRANSFER=y

       Applications -> System Add-Ons
         CONFIG_SYSTEM_I2CTOOL=y
         CONFIG_I2CTOOL_MINBUS=1
         CONFIG_I2CTOOL_MAXBUS=2
         CONFIG_I2CTOOL_MINADDR=0x0
         CONFIG_I2CTOOL_MAXADDR=0xf0
         CONFIG_I2CTOOL_MAXREGADDR=0xff
         CONFIG_I2CTOOL_DEFFREQ=100000

  nx:

    This configuration has been used to bring up the  Sharp Memory LCD
    on a custom board.  This NX configuration was used for testing that
    LCD.  Debug output will appear on USART1.

    NOTES:
    1. Currently configured for the STM32F103CB.  But this is easily
       reconfigured:

       CONFIG_ARCH_CHIP_STM32F103RB=n
       CONFIG_ARCH_CHIP_STM32F103CB=y

    2. You won't be able to buy a Sharp Memory LCD to use with your
       Maple.  If you want one, you will have to make one yourself.

  usbnsh:

    This is an alternative NuttShell (NSH) configuration that uses a USB
    serial console for interaction.

    NOTES:
    1. Currently configured for the STM32F103CB.  But this is easily
       reconfigured:

       CONFIG_ARCH_CHIP_STM32F103RB=n
       CONFIG_ARCH_CHIP_STM32F103CB=y

    2. Support for the I2C tool has been disabled, but can be restored
       with following configure options:

       System Type -> Peripherals
         CONFIG_STM32_I2C1=y
         CONFIG_STM32_I2C2=y
         CONFIG_STM32_I2CTIMEOSEC=1
         CONFIG_STM32_I2CTIMEOMS=500
         CONFIG_STM32_I2CTIMEOTICKS=500

       Drivers
        CONFIG_I2C=y
        CONFIG_I2C_TRANSFER=y

       Applications -> System Add-Ons
         CONFIG_SYSTEM_I2CTOOL=y
         CONFIG_I2CTOOL_MINBUS=1
         CONFIG_I2CTOOL_MAXBUS=2
         CONFIG_I2CTOOL_MINADDR=0x0
         CONFIG_I2CTOOL_MAXADDR=0xf0
         CONFIG_I2CTOOL_MAXREGADDR=0xff
         CONFIG_I2CTOOL_DEFFREQ=100000