Skip to content

Commit

Permalink
AP_HAL_ChibiOS: add define for bootloader to find first DMA SAFE Memory
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator committed Jul 3, 2024
1 parent 830b9e2 commit bd5f81c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,13 @@ def write_mcu_config(self, f):
f.write('#define HAL_CC_MEMORY_REGIONS %s\n' % ', '.join(cc_regions))
f.write('#define HAL_MEMORY_TOTAL_KB %u\n' % (total_memory/1024))

if self.is_bootloader_fw() and not (ram_map[0][2] & 0x01):
# if first memory region is DMA safe then nothing to do
for (address, size, flags) in ram_map:
if flags & 0x01:
f.write('#define HAL_DMA_SAFE_MEM_START 0x%x' % address)
break

f.write('\n// CPU serial number (12 bytes)\n')
udid_start = self.get_mcu_config('UDID_START')
if udid_start is None:
Expand Down

0 comments on commit bd5f81c

Please sign in to comment.