xiaoxiang781216 commented on code in PR #1872:
URL: https://github.com/apache/nuttx-apps/pull/1872#discussion_r1279083042


##########
system/ofloader/segger.c:
##########
@@ -0,0 +1,244 @@
+/****************************************************************************
+ * apps/system/ofloader/segger.c

Review Comment:
   > Maybe it's worth moving the whole `ofloader` to the kernel side ?
   
   It could be, but we want ofloader could work passively in the background. 
Actually, ofloader is just one of component in bootloader:
   
   1. bootloader support multiple download methods(ymodem, ofloader, 
fastboot...), all work in the background
   2. bootloader launch the full feature nuttx in normal case, but launch above 
programs in download mode
   
   If, bootloader partition is broken in some extreme case, user could load 
bootloader to SRAM through JLINK.
   
   > Is it foreseen that the `ofloader` will be run from NSH? or only as an 
entry point?
   
   Yes, it's better to run from NSH since we want to support multiple flash 
method(e.g. ymodem, fastboot and ofloader) at the same time.
   
   > 
   > If we want to keep it in apps then we should use `boardctl` interface to 
call `__start`.
   
   Here is how it work under JLINK:
   
   1. JLINK load ofloader to SRAM through JTAG
   3. JLINK jump PC to SEGGER_FL_Prepare 
   4. SEGGER_FL_Prepare initialize the chip and return
   5. JLINK prepare the data and jump PC to SEGGER_FL_Program
   6. SEGGER_FL_Program write a chunk of data to flash and return
   
   Repeat step 4-5 until the whole image is written to flash. The whole flash 
is controlled by JLINK, and boardctl can't work here, since __start can only 
run once. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to