Comments (2)
@dhalbert Thank you for letting me know. I'm currently checking if we can change the assert in NuttX to also work in CircuitPython. But this is not a quick solution. This will take time.
However, in the meantime I noticed that the Spresense SDK is built with the NDEBUG flag: https://github.com/sonydevworld/spresense-exported-sdk/blob/c12296c5ffbd0779e630a653c76a78558b463271/nuttx/.config#L58
But the configuration was not used in CircuitPython. Below is a patch that fixes this:
diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile
index 238edb96e4..81b1b171e3 100644
--- a/ports/cxd56/Makefile
+++ b/ports/cxd56/Makefile
@@ -23,6 +23,7 @@
# THE SOFTWARE.
include ../../py/circuitpy_mkenv.mk
+include ./spresense-exported-sdk/nuttx/.config
CROSS_COMPILE = arm-none-eabi-
@@ -91,6 +92,10 @@ CFLAGS += \
-fdata-sections \
-Wall \
+ifeq ($(CONFIG_NDEBUG),y)
+ CFLAGS += -DNDEBUG
+endif
+
OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions
# option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk
At this point you should be able to build CircuitPython without any problem with Spresense. However, when the NDEBUG flag is enabled, assert will do nothing.
Maybe CircuitPython could have its own assert implementation? What do you think about this?
from spresense.
Thanks for your comments. Right now we simply removed the troublesome assert, and that may be all we need to do. In the long run perhaps we could talk to the nuttx people about the issue. It does seem to be a rare problem, though. We will also see about NDEBUG, as you mentioned.
from spresense.
Related Issues (20)
- The revision nuttx-tools written at README.md fails "tools/config.py examples/hello" HOT 3
- Can't get code to compile on Mac M1 HOT 3
- Using the code with sensor data as model input HOT 2
- Issue with SDK getting stated guide HOT 1
- Hard-coding /bin/bash on macOS will use the ancient bundled version
- build_env.sh source error HOT 2
- Unable to run spresense SDK example "bluetooth_le_central" with bluetooth module HM-10 HOT 1
- Better OpenOCD config HOT 1
- Why should we enable power_button pin of alt1250? HOT 3
- Why RTC lower-half driver calls a function from upper-half one? HOT 2
- gs2200m association failed : retrying : multiwebcam HOT 2
- Unable to setup SDK CLI for windows 10 HOT 8
- Are there micro SD cards that work and micro SD cards that don't?
- How can I setup spresense board with RFID module. HOT 2
- The SDK example fsperf not working. HOT 2
- Audio subsystem Memory manager compatibility with malloc(). HOT 2
- LTE fails to initialize after reboot by watchdog timer HOT 1
- Makefiles broken on Windows/MSYS HOT 1
- AAC codec? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spresense.