diff --git a/boards/raytac_mdbt50q_rx.json b/boards/raytac_mdbt50q_rx.json index 7e96244e..2964d348 100644 --- a/boards/raytac_mdbt50q_rx.json +++ b/boards/raytac_mdbt50q_rx.json @@ -10,19 +10,15 @@ "hwids": [ [ "0x239A", - "0x8029" + "0x810B" ], [ "0x239A", - "0x0029" + "0x010B" ], [ "0x239A", - "0x002A" - ], - [ - "0x239A", - "0x802A" + "0x810C" ] ], "usb_product": "Raytac MDBT50Q - RX", diff --git a/builder/frameworks/arduino b/builder/frameworks/arduino index 52bf7012..c9d58ac7 160000 --- a/builder/frameworks/arduino +++ b/builder/frameworks/arduino @@ -1 +1 @@ -Subproject commit 52bf7012b5710212a1d136e6180d8ad6b19f6ce6 +Subproject commit c9d58ac7759ff68f7d49ffdb6188433843bd5d15 diff --git a/builder/main.py b/builder/main.py index e77d0061..0d94143a 100644 --- a/builder/main.py +++ b/builder/main.py @@ -55,19 +55,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 use_adafruit = board.get( "build.bsp.name", "nrf5") == "adafruit" and "arduino" in env.get("PIOFRAMEWORK", []) -if use_adafruit: - FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoadafruitnrf52") - - os_platform = sys.platform - if os_platform == "win32": - nrfutil_path = join(FRAMEWORK_DIR, "tools", "adafruit-nrfutil", os_platform, "adafruit-nrfutil.exe") - elif os_platform == "darwin": - nrfutil_path = join(FRAMEWORK_DIR, "tools", "adafruit-nrfutil", "macos", "adafruit-nrfutil") - else: - nrfutil_path = "adafruit-nrfutil" -else: - # set it to empty since we won't need it - nrfutil_path = "" env.Replace( AR="arm-none-eabi-ar", @@ -143,7 +130,9 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 BUILDERS=dict( PackageDfu=Builder( action=env.VerboseAction(" ".join([ - '"%s"' % nrfutil_path, + "$PYTHONEXE", + '"%s"' % join(platform.get_package_dir( + "tool-adafruit-nrfutil") or "", "adafruit-nrfutil.py"), "dfu", "genpkg", "--dev-type", @@ -157,16 +146,28 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 suffix=".zip" ), SignBin=Builder( - action=env.VerboseAction(" ".join([ - "$PYTHONEXE", - join(FRAMEWORK_DIR or "", - "tools", "pynrfbintool", "pynrfbintool.py"), - "--signature", - "$TARGET", - "$SOURCES" - ]), "Signing $SOURCES"), - suffix="_signature.bin" - ) + action=env.VerboseAction( + " ".join( + [ + "$PYTHONEXE", + join( + platform.get_package_dir( + "framework-arduinoadafruitnrf52" + ) + or "", + "tools", + "pynrfbintool", + "pynrfbintool.py", + ), + "--signature", + "$TARGET", + "$SOURCES", + ] + ), + "Signing $SOURCES", + ), + suffix="_signature.bin", + ), ) ) @@ -319,7 +320,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 elif upload_protocol == "nrfutil": env.Replace( - UPLOADER=nrfutil_path, + UPLOADER=join(platform.get_package_dir( + "tool-adafruit-nrfutil") or "", "adafruit-nrfutil.py"), UPLOADERFLAGS=[ "dfu", "serial", @@ -329,7 +331,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621 "$UPLOAD_SPEED", "--singlebank", ], - UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS -pkg $SOURCE' + UPLOADCMD='"$PYTHONEXE" "$UPLOADER" $UPLOADERFLAGS -pkg $SOURCE' ) upload_actions = [ env.VerboseAction(BeforeUpload, "Looking for upload port..."), @@ -359,7 +361,7 @@ def _jlink_cmd_script(env, source): if not isdir(build_dir): makedirs(build_dir) script_path = join(build_dir, "upload.jlink") - commands = [ "h" ] + commands = ["h"] if "DFUBOOTHEX" in env: commands.append("loadbin %s,%s" % (str(source).replace("_signature", ""), env.BoardConfig().get("upload.offset_address", "0x26000"))) diff --git a/examples/arduino-bluefruit-bleuart/platformio.ini b/examples/arduino-bluefruit-bleuart/platformio.ini index eeee3bf2..93a3b5cb 100644 --- a/examples/arduino-bluefruit-bleuart/platformio.ini +++ b/examples/arduino-bluefruit-bleuart/platformio.ini @@ -25,7 +25,6 @@ platform = nordicnrf52 framework = arduino board = nrf52840_dk_adafruit monitor_speed = 115200 - [env:adafruit_metro_nrf52840] platform = nordicnrf52 framework = arduino @@ -43,5 +42,4 @@ platform = nordicnrf52 framework = arduino board = particle_xenon monitor_speed = 115200 -build_flags = -DLED_BLUE=LED_RGB_BLUE diff --git a/examples/zephyr-net-echo-client/src/common.h b/examples/zephyr-net-echo-client/src/common.h index b514aff9..7e2a898d 100644 --- a/examples/zephyr-net-echo-client/src/common.h +++ b/examples/zephyr-net-echo-client/src/common.h @@ -33,8 +33,8 @@ struct data { struct { int sock; /* Work controlling udp data sending */ - struct k_delayed_work recv; - struct k_delayed_work transmit; + struct k_work_delayable recv; + struct k_work_delayable transmit; uint32_t expecting; uint32_t counter; uint32_t mtu; diff --git a/examples/zephyr-net-echo-client/src/udp.c b/examples/zephyr-net-echo-client/src/udp.c index 0dd2ee5f..e7ad7f3f 100644 --- a/examples/zephyr-net-echo-client/src/udp.c +++ b/examples/zephyr-net-echo-client/src/udp.c @@ -40,7 +40,7 @@ static int send_udp_data(struct data *data) LOG_DBG("%s UDP: Sent %d bytes", data->proto, data->udp.expecting); - k_delayed_work_submit(&data->udp.recv, UDP_WAIT); + k_work_reschedule(&data->udp.recv, UDP_WAIT); return ret < 0 ? -EIO : 0; } @@ -83,8 +83,8 @@ static int start_udp_proto(struct data *data, struct sockaddr *addr, { int ret; - k_delayed_work_init(&data->udp.recv, wait_reply); - k_delayed_work_init(&data->udp.transmit, wait_transmit); + k_work_init_delayable(&data->udp.recv, wait_reply); + k_work_init_delayable(&data->udp.transmit, wait_transmit); #if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS) data->udp.sock = socket(addr->sa_family, SOCK_DGRAM, IPPROTO_DTLS_1_2); @@ -168,11 +168,11 @@ static int process_udp_proto(struct data *data) data->udp.counter); } - k_delayed_work_cancel(&data->udp.recv); + k_work_cancel_delayable(&data->udp.recv); /* Do not flood the link if we have also TCP configured */ if (IS_ENABLED(CONFIG_NET_TCP)) { - k_delayed_work_submit(&data->udp.transmit, UDP_SLEEP); + k_work_reschedule(&data->udp.transmit, UDP_SLEEP); ret = 0; } else { ret = send_udp_data(data); @@ -251,8 +251,8 @@ int process_udp(void) void stop_udp(void) { if (IS_ENABLED(CONFIG_NET_IPV6)) { - k_delayed_work_cancel(&conf.ipv6.udp.recv); - k_delayed_work_cancel(&conf.ipv6.udp.transmit); + k_work_cancel_delayable(&conf.ipv6.udp.recv); + k_work_cancel_delayable(&conf.ipv6.udp.transmit); if (conf.ipv6.udp.sock >= 0) { (void)close(conf.ipv6.udp.sock); @@ -260,8 +260,8 @@ void stop_udp(void) } if (IS_ENABLED(CONFIG_NET_IPV4)) { - k_delayed_work_cancel(&conf.ipv4.udp.recv); - k_delayed_work_cancel(&conf.ipv4.udp.transmit); + k_work_cancel_delayable(&conf.ipv4.udp.recv); + k_work_cancel_delayable(&conf.ipv4.udp.transmit); if (conf.ipv4.udp.sock >= 0) { (void)close(conf.ipv4.udp.sock); diff --git a/platform.json b/platform.json index 95ad349b..75630617 100644 --- a/platform.json +++ b/platform.json @@ -18,7 +18,7 @@ "type": "git", "url": "https://github.com/platformio/platform-nordicnrf52.git" }, - "version": "8.1.0", + "version": "8.2.0", "frameworks": { "arduino": { "package": "framework-arduinonordicnrf5", @@ -56,7 +56,7 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~1.2100.0" + "version": "~1.2400.0" }, "framework-arduinonordicnrf5": { "type": "framework", @@ -68,123 +68,24 @@ "type": "framework", "optional": true, "owner": "platformio", - "version": "~2.1.0" + "version": "~2.3.0" }, - "framework-zephyr": { + "framework-cmsis": { "type": "framework", "optional": true, "owner": "platformio", - "version": "~2.20500.0" - }, - "framework-zephyr-cmsis": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.c3bd2094f9" - }, - "framework-zephyr-canopennode": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.468d350028" - }, - "framework-zephyr-civetweb": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.e6903b80c0" - }, - "framework-zephyr-fatfs": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.1d1fcc725a" - }, - "framework-zephyr-hal-nordic": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.f0d54d8449" + "version": "~2.50700.0" }, - "framework-zephyr-hal-st": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.b52fdbf4b6" - }, - "framework-zephyr-libmetal": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.9d4ee2c3cf" - }, - "framework-zephyr-lvgl": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.31acbaa36e" - }, - "framework-zephyr-mbedtls": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.24d84ecff1" - }, - "framework-zephyr-mcuboot": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.3fc59410b6" - }, - "framework-zephyr-mcumgr": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.43845e883f" - }, - "framework-zephyr-open-amp": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.de1b85a130" - }, - "framework-zephyr-loramac-node": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.3f545d76a2" - }, - "framework-zephyr-openthread": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.1d668284a0" - }, - "framework-zephyr-segger": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.38c79a447e" - }, - "framework-zephyr-sof": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.b5b772dd61" - }, - "framework-zephyr-tinycbor": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.40daca97b4" - }, - "framework-zephyr-tinycrypt": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.3e9a49d267" - }, - "framework-zephyr-littlefs": { - "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.9e4498d1c7" - }, - "framework-zephyr-mipi-sys-t": { + "framework-zephyr": { + "type": "framework", "optional": true, "owner": "platformio", - "version": "0.0.0-alpha+sha.75e671550a" + "version": "~2.20600.0" }, - "framework-zephyr-tfm-mcuboot": { - "optional": true, + "tool-adafruit-nrfutil": { "owner": "platformio", - "version": "1.7.0-rc1" - }, - "framework-zephyr-trusted-firmware-m": { "optional": true, - "owner": "platformio", - "version": "0.0.0-alpha+sha.96340fb6c0" + "version": "~1.503.0" }, "tool-sreccat": { "owner": "platformio", diff --git a/platform.py b/platform.py index 9a4a42ba..7e11ced3 100644 --- a/platform.py +++ b/platform.py @@ -39,6 +39,8 @@ def configure_default_packages(self, variables, targets): "nrf5") == "adafruit": self.frameworks["arduino"][ "package"] = "framework-arduinoadafruitnrf52" + self.packages["framework-cmsis"]["optional"] = False + self.packages["tool-adafruit-nrfutil"]["optional"] = False if "mbed" in frameworks: deprecated_boards_file = os.path.join( @@ -51,11 +53,7 @@ def configure_default_packages(self, variables, targets): if "zephyr" in frameworks: for p in self.packages: - if p.startswith("framework-zephyr-") or p in ( - "tool-cmake", - "tool-dtc", - "tool-ninja", - ): + if p in ("tool-cmake", "tool-dtc", "tool-ninja"): self.packages[p]["optional"] = False self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0" if "windows" not in get_systype():