Skip to content

Unable to compile ArduinoJSON on ClearCore board #1947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sfactor33 opened this issue Jul 13, 2023 · 1 comment · May be fixed by Teknic-Inc/ClearCore-Arduino-wrapper#4
Closed

Unable to compile ArduinoJSON on ClearCore board #1947

sfactor33 opened this issue Jul 13, 2023 · 1 comment · May be fixed by Teknic-Inc/ClearCore-Arduino-wrapper#4

Comments

@sfactor33
Copy link

Unable to compile ArduinoJSON in Arduino IDE V1.8.19 using ClearCore board package V1.1.2.

Fixed as suggested by https://forum.arduino.cc/t/solved-esp8266-pgm-read-ptr-error-const-void-is-not-a-pointer-to-object-type/1037766/6

#define ARDUINOJSON_ENABLE_PROGMEM 0
#include <ArduinoJson.h>

With the added #define, it compiles and JsonGeneratorExample works properly.

Environment
Here is the environment that I used:
ClearCore board using SAMD5xN processor
Arduino IDE V1.8.19 using ClearCore board package V1.1.2

Compiler output
In file included from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/ArduinoString.h:32:0,
from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/Print.h:24,
from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/Stream.h:24,
from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/Client.h:22,
from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/ArduinoAPI.h:29,
from C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/Arduino.h:24,
from sketch\JsonGeneratorExample.ino.cpp:1:
D:\My Documents\Arduino\libraries\arduino_745846\src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'const T* ArduinoJson::V6212PB::detail::pgm_read(const T* const*) [with T = char]':
D:\My Documents\Arduino\libraries\arduino_745846\src/ArduinoJson/Deserialization/DeserializationError.hpp:85:42: required from here
C:\Users\MainUser\AppData\Local\Arduino15\packages\ClearCore\hardware\sam\1.1.2\cores\arduino/api/deprecated-avr-comp/avr/pgmspace.h:106:29: error: 'const void*' is not a pointer-to-object type
#define pgm_read_ptr(addr) (*(const void *)(addr))
~^~~~~~~~~~~~~~~~~~~~~~
exit status 1
Error compiling for board Teknic ClearCore.

@sfactor33 sfactor33 added the bug label Jul 13, 2023
bblanchon added a commit to bblanchon/ClearCore-Arduino-wrapper that referenced this issue Jul 14, 2023
Calling this macro causes the error "'const void*' is not a pointer-to-object type"

Related to arduino/ArduinoCore-API#118
Fixes bblanchon/ArduinoJson#1947
@bblanchon bblanchon added duplicate and removed bug labels Jul 15, 2023
@bblanchon
Copy link
Owner

Hi @sfactor33,

Thanks for reporting this issue.
This bug is not in ArduinoJson but in ClearCore's Arduino core and they inherited it from Arduino's hardware independent core.

I opened a Pull Request there, so I'll close this issue.
Until the fix is available, you can set ARDUINOJSON_ENABLE_PROGMEM to 0; this platform doesn't support PROGMEM anyway.

Duplicate of #1442, #1519, #1536, #1591, #1676, #1790, and #1874.

Best regards,
Benoit

@bblanchon bblanchon closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants