Closed NW-Lab closed 11 months ago
Thank you for the report. On macOS, there is no link error building for nrf52/xiao
. It looks like the nrfx_pwm_*
functions aren't present in your build. We'll check the Windows build.
We'll get that fixed in the next repository update.
But for now, in %MODDABLE%\tools\mcconfig\nmake.nrf52.mk
, at about line 320, add $(LIB_DIR)\nrfx_pwm.o
.
diff --git a/tools/mcconfig/nmake.nrf52.mk b/tools/mcconfig/nmake.nrf52.mk
index 29ddb5584..01dd8bcad 100644
--- a/tools/mcconfig/nmake.nrf52.mk
+++ b/tools/mcconfig/nmake.nrf52.mk
@@ -317,6 +317,7 @@ NRF_DRIVERS_OBJ = \
$(LIB_DIR)\nrfx_power.o \
$(LIB_DIR)\nrfx_ppi.o \
$(LIB_DIR)\nrfx_prs.o \
+ $(LIB_DIR)\nrfx_pwm.o \
$(LIB_DIR)\nrfx_qdec.o \
$(LIB_DIR)\nrfx_saadc.o \
$(LIB_DIR)\nrfx_spim.o \
After the modification, compilation became OK. But I can't connect to xsbug. Looks like some more fixes are needed. I'll take a look and report.
thank you
We did some tests to see if we can reproduce the problem.
We used the following flow which logs the following on Moddable Four:
The flow builds and runs on both macOS and Windows. The output is logged to xsbug as expected. The test was done from the command line using mcconfig -d -m -p nrf52/moddable_four
to build.
I'm not sure if this flow will run on your hardware, since the pins connections will be different (you can delete or modify the nodes as needed). But, the test confirms that fundamentals are working. Does something like that work for you?
@phoddie san thank you for your reply. When using Node-RED MCU Plugin, Node-RED Editor and Xsbug are not connecting properly.
I have confirmed that xsbug and device (xiao) are successfully connected in moddable's example/helloworld.
I changed the injector to work when I started it, and it showed up in Debug in the Node-Red Editor. However, there is no response when I press the Injector button. So that's it MCU --> Node-RED Editor OK Node-RED Editor --> MCU NG
I haven't checked yet, but Mac and Linux makefiles are different than Windows makefiles, so I think this is probably the problem.
make.nrf52.mk
ifeq ($(DEBUG),1)
ifeq ($(XSBUG_LOG),1)
DO_XSBUG =
CONNECT_XSBUG=@echo "Connect to xsbug." ; cd $(MODDABLE)/tools/xsbug-log && XSBUG_PORT=$(XSBUG_PORT) XSBUG_HOST=$(XSBUG_HOST) node xsbug-log serial2xsbug $(M4_VID):$(M4_PID) 921600 8N1
NORESTART=-norestart
WAIT_FOR_COPY_COMPLETE =
else
DO_XSBUG = open -a $(MODDABLE_TOOLS_DIR)/xsbug.app -g
CONNECT_XSBUG=@echo "Connect to xsbug." ; XSBUG_PORT=$(XSBUG_PORT) XSBUG_HOST=$(XSBUG_HOST) serial2xsbug $(M4_VID):$(M4_PID) 921600 8N1
NORESTART=-norestart
WAIT_FOR_COPY_COMPLETE =
endif
else
DO_XSBUG =
CONNECT_XSBUG =
NORESTART =
WAIT_FOR_COPY_COMPLETE = $(PLATFORM_DIR)/config/waitForVolume -x $(UF2_VOLUME_PATH)
endif
nmake.nrf52.mk
!IF "$(DEBUG)"=="1"
DO_XSBUG = tasklist /nh /fi "imagename eq xsbug.exe" | find /i "xsbug.exe" > nul || (start $(MODDABLE_TOOLS_DIR)\xsbug.exe)
KILL_SERIAL_2_XSBUG =-tasklist /nh /fi "imagename eq serial2xsbug.exe" | (find /i "serial2xsbug.exe" > nul) && taskkill /f /t /im "serial2xsbug.exe" >nul 2>&1
WAIT_FOR_NEW_SERIAL = $(PLATFORM_DIR)\config\waitForNewSerialWindows.bat 1 $(UF2_VOLUME_NAME) $(TMP_DIR)\_port.tmp $(M4_VID) $(M4_PID)
SERIAL_2_XSBUG = echo Starting serial2xsbug. Type Ctrl-C twice after debugging app. && $(MODDABLE_TOOLS_DIR)\serial2xsbug $(M4_VID):$(M4_PID) $(DEBUGGER_SPEED) 8N1 -dtr
NORESTART =
!ELSE
DO_XSBUG =
KILL_SERIAL_2_XSBUG =
WAIT_FOR_NEW_SERIAL = $(PLATFORM_DIR)\config\waitForNewSerialWindows.bat 0 $(UF2_VOLUME_NAME) $(TMP_DIR)\_port.tmp $(M4_VID) $(M4_PID)
SERIAL_2_XSBUG =
NORESTART =
!ENDIF
Thank you,
Interesting. It looks like the change to remove "kill serial2xsbug" didn't make it to nRF52 Windows. What happens if you change
KILL_SERIAL_2_XSBUG =-tasklist /nh /fi "imagename eq serial2xsbug.exe" | (find /i "serial2xsbug.exe" > nul) && taskkill /f /t /im "serial2xsbug.exe" >nul 2>&1
...to...
KILL_SERIAL_2_XSBUG =
...so that serial2xsbug is left as-is as intended?
https://github.com/Moddable-OpenSource/moddable/pull/1211
I did a PR. Thank you.
Thank you for the PR. It is really great you worked through that. We'll have the merged in a day or so.
Regarding my comment above about "kill serial2xsbug" -- that was mistaken. There were changes to not kill xsbug
. That was unrelated to serial2xsbug
.
@NextWorldLab, which node-red version are you using?
@mkellner san
I confirmed the operation with node-red 3.0.2 and 3.1. 3.1 is not yet supported by NodeRED MCU Plugin, so I am making a pull request.
It can be used in the following ways
cd %USERPROFILE%\.node-red
npm install https://github.com/NextWorldLab/node-red-mcu-plugin
thank you,
Excellent. Thank you for the 3.1 patch. I verified the fix. It will be in the next code drop.
Hello,
When I try to check with the simple flow of Node-RED MCU, a link error occurs. I got the same error both in Plugin and in CLI.
Sorry if this is not the repository.
environment Windows Node-RED 3.1 device nrf52/xiao
flow![image](https://github.com/Moddable-OpenSource/moddable/assets/8869009/c10dada3-9c86-400c-a525-69b900ee2c45)
command
Output
Thanks,