Skip to content

Commit 55ec9b0

Browse files
authored
Merge pull request #1097 from pennam/plc-ide-section
mbed-os-to-arduino: add dedicated plc section to linker script
2 parents 53bbb4b + 65aa13b commit 55ec9b0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mbed-os-to-arduino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ generate_flags () {
221221
sed -i "s?.heap (COPY)?.heap (NOLOAD)?g" $ARDUINOVARIANT/linker_script.ld
222222
sed -i "s?.stack_dummy (COPY)?.stack_dummy (NOLOAD)?g" $ARDUINOVARIANT/linker_script.ld
223223
fi
224+
225+
if [[ $ARDUINOVARIANT == *OPTA* ]]; then
226+
echo "Adding PLC section to $ARDUINOVARIANT/linker_script.ld"
227+
PLC_SECTION=".plc_d3_section 0x3800F000 (NOLOAD): {\n \
228+
*(.plc_buffer)\n \
229+
} > RAM_D3\n \
230+
.plc_d2_section 0x30000000 (NOLOAD): {\n \
231+
*(.plc_code)\n \
232+
} > RAM_D2\n"
233+
sed -i "s?.heap (COPY):?${PLC_SECTION} .heap (COPY):?g" $ARDUINOVARIANT/linker_script.ld
234+
fi
224235
fi
225236
echo "Patching linker scripts"
226237
sed -i 's/0x8100000/CM4_BINARY_START/g' "$ARDUINOVARIANT"/linker_script.ld

0 commit comments

Comments
 (0)