Hello all,
when programming the GIGA using both cores the IDE does not remember the Flash Split and Target Core settings when moving between the M7 and M4 core windows. This is quite annoying as I have already mis-flashed the cores, which confuses the CPU completely. Is there a chance to correct this in some future version of the IDE?
regards
Herbert
Hi @herbschi . It sounds like this bug:
opened 07:45AM - 27 Sep 23 UTC
closed 03:34PM - 27 Sep 23 UTC
conclusion: resolved
topic: code
type: imperfection
### Describe the problem
Arduino boards platform authors can define arbitrary… [custom board options](https://arduino.github.io/arduino-cli/dev/platform-specification/#custom-board-options) to provide additional configurability for a given board selection. These options are presented to the Arduino IDE user as arbitrary submenus under the IDE's **Tools** menu.
🐛 If the user changes the setting in a custom board option menu in one menu, compilations and uploads for the board in other windows will also use that custom board option setting instead of the one the user had selected in that window.
### To reproduce
1. Select **File > New Sketch** from the Arduino IDE menus.
I will refer to the IDE window that opens as "window A" from here on.
1. Select **File > Preferences...** (or **Arduino IDE > Settings...** for macOS users) from the Arduino IDE menus.
The "**Preferences**" dialog will open.
1. Check the box next to "**Show verbose output during: ☐ compilation**" in the "**Preferences**" dialog.
1. Click the "**OK**" button.
1. Select **Tools > Board > Arduino AVR Boards > Arduino Nano** from the Arduino IDE menus.
**ⓘ** This board was selected arbitrarily for the demo. The fault will occur with any board that has a custom board option.
1. Select **Tools > Processor > ATmega328P (Old bootloader)** from the Arduino IDE menus.
**ⓘ** This setting was selected arbitrarily for the demo. The fault will occur with any custom board option setting.
1. Select **Sketch > Verify/Compile** from the Arduino IDE menus.
1. Scroll up to the top of the "**Output**" view.
🙂 The FQBN shown there is as expected for the custom board option setting:
```text
FQBN: arduino:avr:nano:cpu=atmega328old
```
1. Select **File > New Sketch** from the Arduino IDE menus.
I will refer to the IDE window that opens as "window B" from here on.
1. Select **Tools > Processor > ATmega168** from the Arduino IDE menus.
1. Select **Sketch > Verify/Compile** from the Arduino IDE menus.
1. Scroll up to the top of the "**Output**" view.
🙂 The FQBN shown there is as expected for the custom board option setting:
```text
FQBN: arduino:avr:nano:cpu=atmega168
```
1. Switch back to "window A".
1. Open the **Tools > Processor** menu (❗ Don't select anything; only open the menu).
🙂 The **ATmega328P (Old bootloader)** setting you chose in step (6) is still selected, as expected.
1. Select **Sketch > Verify/Compile** from the Arduino IDE menus.
1. Scroll up to the top of the "**Output**" view.
🐛 The FQBN shown there does not match the setting of the window's **Tools > Processor** menu. Instead, it is the FQBN for the setting made in "window B":
```text
FQBN: arduino:avr:nano:cpu=atmega168
```
### Expected behavior
The board selection in each IDE window can be configured independently without any effect on the configuration of other windows.
### Arduino IDE version
ed2d8ad
### Operating system
Windows
### Operating system version
11
### Additional context
I checked for the fault in various IDE versions going all the way back to 2.0.0-beta.1 and was able to reproduce it with all of them. So it seems this is not a regression.
I looked for existing issues without finding any, but it is possible there might be some that are reports of the final symptoms of an unexpected configuration being applied to a given board (e.g., an upload failure) instead of the immediate symptom of incorrect content in the compilation output as I was able to identify and report here.
<a name="workaround"></a>
#### Workaround
Select the desired settings from each custom board option menu before compiling or uploading, even though the IDE's GUI shows the desired setting is already selected from the menu.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
That bug has already been fixed, but the fix was made after the time of the Arduino IDE 2.2.1 release so it is currently only available when using the latest nightly build of Arduino IDE.
If you would like to give it a try, the nightly build download links are listed here:
https://www.arduino.cc/en/software#nightly-builds
You can have both the nightly build and release version of Arduino IDE installed at the same time, so there is no requirement to uninstall version 2.2.1 before installing the nightly if you don't want.
Alternatively you can wait for the next production release of Arduino IDE to come out, which will also have the fix.
If you give it a try, let us know how it goes!
I thought I should add a note that there is a remaining bug that can cause the IDE to forget the setting under certain conditions:
opened 05:31PM - 30 Oct 23 UTC
topic: code
type: imperfection
### Describe the problem
For the convenience of the user, Arduino IDE automat… ically configures the board and port selection of a new IDE window according to the configuration of the previous window.
In addition to the primary board selection, some board definitions have ["custom board options"](https://arduino.github.io/arduino-cli/dev/platform-specification/#custom-board-options) that allow additional configuration via arbitrary submenus added under the **Tools** menu.
🐛 The configuration of the custom board options revert to the default values when a new window is opened.
### To reproduce
1. Select **Tools > Board > Arduino AVR Boards > Arduino Nano** from the Arduino IDE menus.
1. Select **Tools > Processor > ATmega168** from the Arduino IDE menus.
1. Select **File > New Sketch** from the Arduino IDE menus.
A new window will open.
1. Open the **Tools** menu in the new window.
🐛 The default **ATmega328P** option is selected in the **Tools > Processor** custom board option menu.
1. Select **Tools > Processor > ATmega168** from the Arduino IDE menus.
Select **File > Save As...** from the Arduino IDE menus.
1. Save the sketch to any name and location.
1. Open the **Tools** menu in the new window.
🐛 The default **ATmega328P** option is selected in the **Tools > Processor** custom board option menu.
### Expected behavior
The custom board options configuration from the parent window are used in new windows.
### Arduino IDE version
69b7365
### Operating system
Windows
### Operating system version
11
### Additional context
The behavior described here was introduced at ce02e263ec336c84739aed5fc43f7a1ac16cfd79 / https://github.com/arduino/arduino-ide/pull/2241.
The described behavior does not occur when using the IDE build from ed2d8ad or earlier (but note those versions had a related fault https://github.com/arduino/arduino-ide/issues/2240).
---
Originally reported by @mjs513 at https://forum.arduino.cc/t/is-there-a-m4-and-m7-usage-for-dummies-document-d/1180371/10
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://www.arduino.cc/en/software#nightly-builds)
- [X] My report contains all necessary details
This will only occur when you create a new sketch or do a "Save As..." operation. Arduino IDE will correctly remember the setting when you are working with a sketch that has already been saved.
tineira
November 25, 2023, 12:58pm
4
I was going to report the same BUG when I found this thread. As a good practice I started using this compiler directives at the top of the files to make sure I don't upload the wrong code to each core (by this bug or my own error).:
#ifndef CORE_CM4
#error Expected to run on core M4
#endif
#ifndef CORE_CM7
#error Expected to run on core M7
#endif
2 Likes
system
Closed
May 23, 2024, 12:58pm
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.