In order to check whether the IDE 2.0.0-RC5 is already a substitute for the current IDE I tried to compile a file for the Arduino Nano 33 BLE sense. The programm includes a PWM library. That library could not be compiled with IDE 2.00-RC5. The IDE version 1.8.19 has no problems with this library at all.
The error message I get from IDE 2.0.0-RC5 is:
error: 'NRF_PWM0' was not declared in this scope
NRF_PWM0->PSEL.OUT[0] = 0x02E;
Compilation error: exit status 1
It seems to me that at least this PWM keyword is missing. Please check and provide feedback to the community. Thanks
you can find find several pages with example code regarding PWM usage.
The problem starts if you try to do the first step, defining the PWM output pin.
I use PIN D6 which is equal to P1.14.
In order to assign that pin as the PWM output pin you need to do: NRF_PWM0->PSEL.OUT[0] = 0x02E;
If you put only that line into the code the issue starts in IDE2.0.0-rc5.
If you do the same exercise with IDE 1.8.19 the line compiles successfully.
I hope this information can help to reproduce the problem.
That problem is not only related to the keyword mentioned above, it happened with all keywords I tried.
Thanks for the additional information. Unfortunately, I was not able to reproduce the problem.
I'm going to ask you to post some additional information that might help us to identify the problem.
Please do this:
Select File > Preferences from the Arduino IDE menus.
Check the box next to "Show verbose output during: ☐ compilation".
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
Wait for the compilation to end.
Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
From the context menu, click Copy All.
Open a forum reply here by clicking the Reply button.
Click the </> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Please find above the data you asked for.
I take it as a good sign that you can't replicate the issue but unfortunately that does not help me. Looking forward to hear from you.
As you mentioned, this is low level code specific to the Nordic nRF52840 microcontroller used on the Nano 33 BLE Sense. It will not work for other microcontrollers.
You are compiling for the Nano 33 IoT, which uses the Microchip ATSAMD21G18 microcontroller. This is the cause of the error.
If you are using a Nano 33 BLE Sense, you must select Tools > Board > Arduino Mbed OS Nano Boards > Nano 33 BLE from the Arduino IDE menus. After that, your sketch should compile as expected.