This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 9897ef3cdbc55f4bf830e5be3ee11223cc1e3b56 Author: Matteo Golin <matteo.go...@gmail.com> AuthorDate: Mon Jun 2 20:21:07 2025 -0400 docs/arduino-mega2560: Migrate README.txt to RST Migrated legacy README.txt documentation to RST format. Signed-off-by: Matteo Golin <matteo.go...@gmail.com> --- .../atmega2560/boards/arduino-mega2560/README.txt | 107 --------------------- .../boards/arduino-mega2560/arduino-mega2560.png | Bin 0 -> 634731 bytes .../atmega2560/boards/arduino-mega2560/index.rst | 86 +++++++++++++++++ 3 files changed, 86 insertions(+), 107 deletions(-) diff --git a/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/README.txt b/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/README.txt deleted file mode 100644 index 4bd1398304..0000000000 --- a/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/README.txt +++ /dev/null @@ -1,107 +0,0 @@ -README -====== - - This is the README file for the port of NuttX to the Arduino Mega 2560 Rev3. - - https://www.arduino.cc/en/Main/ArduinoBoardMega2560 - - The board is based on ATMega2560 chip from Atmel - - http://www.atmel.com/devices/atmega2560.aspx - -Contents -======== - - o Toolchain - o Serial Console - o Configurations - -Toolchain -========= - - Right now only Atmel's AVR8 Toolchain is supported. You can get it from - - http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx - - It is basically WinAVR compatible so sub-projects may define WinAVR as a - tool-chain but specify path to the Atmel AVR8 in path. See - arduino-mega2560/hello for example. - -Serial Console -============== - - The serial console is available on USART0. You will need to connect an - RS-232 shield or an external RS-232 driver as follows: - - TXD: TX0->1 - RXD: RX0->0 - GND: Power GND - +5V: Power +5V - - You will then need to use a terminal program configured at 38400 8N1. - -Configurations -============== - - Common Configuration Notes - -------------------------- - 1. Each Arduino MEGA2560 configuration is maintained in a sub-directory - and can be selected as follow: - - tools/configure.sh arduino-mega2560:<subdir> - - Where <subdir> is one of the configuration sub-directories described in - the following paragraph. - - 2. These configurations use the mconf-based configuration tool. To - change a configurations using that tool, you should: - - a. Build and install the kconfig-mconf tool. See nuttx/README.txt - see additional README.txt files in the NuttX tools repository. - - b. Execute 'make menuconfig' in nuttx/ in order to start the - reconfiguration process. - - 3. By default, all configurations assume the Atmel Studio AVR8 toolchain - under Cygwin with Windows. This is easily reconfigured: - - CONFIG_HOST_WINDOWS=y - CONFIG_WINDOWS_CYGWIN=y - CONFIG_AVR_BUILDROOT_TOOLCHAIN=y - - 4. Build with GCC disables CONFIG_DEBUG_OPT_UNUSED_SECTIONS by default. - This is because the linker script was not checked to determine - if it properly prevents removal of sections which the linker considers - unreferenced but which must be present in the binary. - - Configuration Sub-Directories - ----------------------------- - hello: - The simple apps/examples/hello "Hello, World!" example. - - nsh: - This is a reduce NuttShell (NSH) configuration using apps/example/nsh. - The serial console is provided on USART0 and can be accessed via - an external RS-232 driver as described above under "Serial Console". - - NOTES: - - 1. As of 2015-01-16, the default static memory usage is: - - $ size nuttx.elf - text data bss dec hex filename - 34348 2117 944 37409 9221 nuttx.elf - - And dynamic, heap usage: - - nsh> free - total used free largest - Mem: 4736 1768 2968 2968 - - There is plenty of FLASH space but not a lot of free SRAM. This - SRAM usage is due primarily to constant strings defined by NSH. - - NOTE: I investigated the possibility of adding IPTR/IOBJ - qualifiers in the NSH library and moving the strings to FLASH. - This is still a possibility but would requires some extensive - changes to NSH. diff --git a/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/arduino-mega2560.png b/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/arduino-mega2560.png new file mode 100644 index 0000000000..c7c409664b Binary files /dev/null and b/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/arduino-mega2560.png differ diff --git a/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/index.rst b/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/index.rst new file mode 100644 index 0000000000..919d52a4d1 --- /dev/null +++ b/Documentation/platforms/avr/atmega/atmega2560/boards/arduino-mega2560/index.rst @@ -0,0 +1,86 @@ +================ +Arduino Mega2560 +================ + +.. tags:: chip:atmega2560, chip:atmega, vendor:arduino, arch:avr + +This is the documentation for the port of NuttX to the `Arduino Mega 2560 Rev3 +<https://www.arduino.cc/en/Main/ArduinoBoardMega2560>`_. The board is based on +the `ATMega2560 chip from Atmel +<http://www.atmel.com/devices/atmega2560.aspx>`_. + +.. figure:: arduino-mega2560.png + :figwidth: 50% + :align: center + :alt: The Arduino ATMega2560 micro-controller board. + + The Arduino ATMega2560 micro-controller board. + +Toolchain +========= + +To learn more about installing the required tool-chain, read the "Toolchain" +section of :doc:`../../index`. + +Configurations +============== + +Each Arduino MEGA2560 configuration is maintained in a sub-directory +and can be selected as follow: + +.. code:: console + + $ tools/configure.sh arduino-mega2560:<subdir> + +Where ``<subdir>`` is one of the configuration sub-directories described in the +following sub-headings. + +By default, all configurations assume the Atmel Studio AVR8 toolchain under +Cygwin with Windows. This is easily reconfigured: + +* ``CONFIG_HOST_WINDOWS=y`` +* ``CONFIG_WINDOWS_CYGWIN=y`` +* ``CONFIG_AVR_BUILDROOT_TOOLCHAIN=y`` + +Build with GCC disables ``CONFIG_DEBUG_OPT_UNUSED_SECTIONS`` by default. This is +because the linker script was not checked to determine if it properly prevents +removal of sections which the linker considers unreferenced but which must be +present in the binary. + +hello +----- + +The simple ``apps/examples/hello`` "Hello, World!" example. The output is +displayed on UART0 at a baud rate of 38400, 8N1. + +nsh +--- + +This is a reduce NuttShell (NSH) configuration using ``apps/example/nsh``. The +serial console is provided on USART0 and can be accessed via a serial terminal +at a baud rate of 38400, 8N1. + +.. note:: + + As of 2015-01-16, the default static memory usage is: + + .. code:: console + + $ size nuttx.elf + text data bss dec hex filename + 34348 2117 944 37409 9221 nuttx.elf + + And dynamic, heap usage: + + .. code:: console + + nsh> free + total used free largest + Mem: 4736 1768 2968 2968 + + There is plenty of FLASH space but not a lot of free SRAM. This + SRAM usage is due primarily to constant strings defined by NSH. + + I investigated the possibility of adding IPTR/IOBJ qualifiers in the NSH + library and moving the strings to FLASH. This is still a possibility but + would require some extensive changes to NSH.