jerpelea opened a new pull request, #16687:
URL: https://github.com/apache/nuttx/pull/16687

   ## Summary
   AVR is a Harvard architecture with separate address spaces for program
   and data memory. Unless the compiler is instructed otherwise, C pointers
   are always referring to the data memory. Variables declared with const
   must therefore be copied to RAM to be accessible - which is undesirable
   since RAM is a limited resource on these chips. There are other
   approaches that can be taken but they are either not supported in NuttX
   or the support is quite limited. (These approaches are described in the
   document added in patch 0002 and adding full support for them would
   require fairly disruptive changes so that is unlikely to happen.)
   
   Newer chips offer an alternative solution - part of the program memory
   (a 32kB window) is mapped into data memory address space. Const
   variables can be placed into this window, making them accessible while
   using standard (data memory) pointers. This patch series adds support
   for this into both AVR architecture code and Breadxavr board.
   
   Series was tested by verifying string addresses - parameters in printf
   call in a custom application - in disassembly (and also by running the
   application and verifying its output.) Documentation was tested by HTML
   build.
   
   Short summary of the patches:
   
   0001 - fixes Ctrl-C error in a comment, unrelated otherwise
   0002 - adds a document that describes previously existing options of 
   avoiding copying const variables into RAM
   0003 - patch that makes use of the memory-mapped flash
   0004 - ops structure in serial driver is marked as const
   
   ## Impact
   
   This patch series should not affect older AVR chips which do not have
   the memory-mapping.
   
   ## Testing
   
   AVR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to