jsanchez-2g opened a new pull request, #20054:
URL: https://github.com/apache/nuttx/pull/20054

   ## Summary
   
   Fix STM32G0 flash erase-bank selection when the flash banks are swapped.
   
   Flash page numbers follow the logical memory mapping, while the FLASH_CR
   BKER bit selects a physical flash bank. When nSWAP_BANK is cleared, the
   physical banks are reversed in the memory map, so BKER must also be
   reversed when erasing a logical address.
   
   ## Validation
   
   - `git diff --check`: passed
   - `tools/checkpatch.sh -g HEAD^..HEAD`: passed
   - Built `stm32_flash_m0_g0c0.c` for STM32G0B1 with
     `CONFIG_STM32_PROGMEM=y`
   - Hardware tested on a 2G BMS Golgi board using two consecutive
     RS-485 firmware updates:
     - Initial state: `FLASH_OPTR=fef9feaa`, nSWAP_BANK set
     - After update 1: `FLASH_OPTR=fee9feaa`, nSWAP_BANK cleared
     - Update 2 was initiated while the banks were swapped
     - After update 2: `FLASH_OPTR=fef9feaa`, nSWAP_BANK set
   - Both updates completed, rebooted into the programmed image, mounted
     the filesystem, initialized communications and BMS hardware, and
     operated normally
   
   The hardware image used the existing product-tree version of the same
   bank-selection correction. The submitted implementation ports that
   logic to the current common STM32 flash driver.
   


-- 
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