Skip to content

Commit 64370f1

Browse files
committed
Add v2.7.0 and v3.1.0
Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Fix Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Fix Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Use ubuntu 20.04 Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Update cmake Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Fix env Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Fix Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Deprecate v2.4.0 Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Update Readme Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Fix CMake Signed-off-by: Pablo Garrido <pablogs9@gmail.com> Update Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
1 parent 4bc9a7e commit 64370f1

File tree

7 files changed

+140
-33
lines changed

7 files changed

+140
-33
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ jobs:
99

1010
micro_ros_zephyr_module:
1111
runs-on: ubuntu-latest
12-
container: ubuntu:20.04
12+
container: ubuntu:22.04
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
zephyr_version: ["zephyr-v2.4.0", "zephyr-v2.5.0", "zephyr-v2.6.0"]
16+
zephyr_version: ["zephyr-v2.5.0", "zephyr-v2.6.0", "zephyr-v2.7.2"]
1717
include:
18-
- zephyr_version: zephyr-v2.4.0
19-
zephyr_sdk: 0.11.4
20-
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-setup.run
2118
- zephyr_version: zephyr-v2.5.0
2219
zephyr_sdk: 0.11.4
2320
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-setup.run
2421
- zephyr_version: zephyr-v2.6.0
2522
zephyr_sdk: 0.12.4
2623
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-x86_64-linux-setup.run
24+
- zephyr_version: zephyr-v2.7.2
25+
zephyr_sdk: 0.13.1
26+
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-linux-x86_64-setup.run
2727
steps:
2828
- uses: actions/checkout@v2
2929
with:
@@ -34,7 +34,7 @@ jobs:
3434
run: |
3535
apt update
3636
export DEBIAN_FRONTEND=noninteractive
37-
apt install -y --no-install-recommends git cmake ninja-build gperf \
37+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
3838
ccache dfu-util device-tree-compiler wget curl gnupg2 \
3939
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
4040
make gcc gcc-multilib g++-multilib libsdl2-dev
@@ -60,7 +60,57 @@ jobs:
6060
source zephyrproject/zephyr/zephyr-env.sh
6161
# Installing micro-ROS prerequisites
6262
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
63-
# Workaround. Remove when https://github.com/sphinx-doc/sphinx/issues/10291 and https://github.com/micro-ROS/micro_ros_zephyr_module/runs/5714546662?check_suite_focus=true
64-
pip3 install --upgrade Sphinx
63+
# Building the app
64+
west build -b disco_l475_iot1 micro_ros_zephyr_module
65+
66+
micro_ros_zephyr_module_v3:
67+
runs-on: ubuntu-latest
68+
container: ubuntu:22.04
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
zephyr_version: ["zephyr-v3.1.0"]
73+
include:
74+
- zephyr_version: zephyr-v3.1.0
75+
zephyr_sdk: 0.14.2
76+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
77+
steps:
78+
- uses: actions/checkout@v2
79+
with:
80+
path: micro_ros_zephyr_module
81+
82+
- name: Dependencies
83+
shell: bash
84+
run: |
85+
apt update
86+
export DEBIAN_FRONTEND=noninteractive
87+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
88+
ccache dfu-util device-tree-compiler wget \
89+
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
90+
make gcc gcc-multilib g++-multilib libsdl2-dev
91+
pip3 install --user -U west
92+
export PATH=~/.local/bin:/github/home/.local/bin:"$PATH"
93+
west init zephyrproject
94+
cd zephyrproject
95+
cd zephyr
96+
git checkout ${{ matrix.zephyr_version }}
97+
cd ..
98+
west update
99+
west zephyr-export
100+
pip3 install --user -r zephyr/scripts/requirements.txt
101+
cd ..
102+
export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
103+
export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
104+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
105+
tar xvf $TOOLCHAIN_FILE_NAME
106+
cd zephyr-sdk-$TOOLCHAIN_VERSION
107+
./setup.sh -h -t arm-zephyr-eabi -c
108+
cd ..
109+
source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
110+
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
111+
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
112+
source zephyrproject/zephyr/zephyr-env.sh
113+
# Installing micro-ROS prerequisites
114+
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
65115
# Building the app
66116
west build -b disco_l475_iot1 micro_ros_zephyr_module

.github/workflows/nightly.yml

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,28 @@ jobs:
1212

1313
micro_ros_zephyr_module:
1414
runs-on: ubuntu-latest
15-
container: ubuntu:20.04
15+
container: ubuntu:22.04
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
zephyr_version: ["zephyr-v2.4.0", "zephyr-v2.5.0", "zephyr-v2.6.0"]
20-
distro: ["foxy", "rolling"]
19+
zephyr_version: ["zephyr-v2.5.0", "zephyr-v2.6.0", "zephyr-v2.7.2"]
20+
distro: ["foxy", "humble", "rolling"]
2121
include:
2222
- distro: foxy
2323
branch: foxy
2424
- distro: rolling
2525
branch: main
26-
- zephyr_version: zephyr-v2.4.0
27-
zephyr_sdk: 0.11.4
28-
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-setup.run
26+
- distro: humble
27+
branch: humble
2928
- zephyr_version: zephyr-v2.5.0
3029
zephyr_sdk: 0.11.4
3130
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-setup.run
3231
- zephyr_version: zephyr-v2.6.0
3332
zephyr_sdk: 0.12.4
3433
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-x86_64-linux-setup.run
34+
- zephyr_version: zephyr-v2.7.2
35+
zephyr_sdk: 0.13.1
36+
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-linux-x86_64-setup.run
3537
steps:
3638
- uses: actions/checkout@v2
3739
with:
@@ -42,7 +44,7 @@ jobs:
4244
run: |
4345
apt update
4446
export DEBIAN_FRONTEND=noninteractive
45-
apt install -y --no-install-recommends git cmake ninja-build gperf \
47+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
4648
ccache dfu-util device-tree-compiler wget curl gnupg2 \
4749
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
4850
make gcc gcc-multilib g++-multilib libsdl2-dev
@@ -68,7 +70,64 @@ jobs:
6870
source zephyrproject/zephyr/zephyr-env.sh
6971
# Installing micro-ROS prerequisites
7072
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
71-
# Workaround. Remove when https://github.com/sphinx-doc/sphinx/issues/10291 and https://github.com/micro-ROS/micro_ros_zephyr_module/runs/5714546662?check_suite_focus=true
72-
pip3 install --upgrade Sphinx
73+
# Building the app
74+
west build -b disco_l475_iot1 micro_ros_zephyr_module
75+
76+
micro_ros_zephyr_module_v3:
77+
runs-on: ubuntu-latest
78+
container: ubuntu:22.04
79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
zephyr_version: ["zephyr-v3.1.0"]
83+
distro: ["foxy", "humble", "rolling"]
84+
include:
85+
- distro: foxy
86+
branch: foxy
87+
- distro: rolling
88+
branch: main
89+
- distro: humble
90+
branch: humble
91+
- zephyr_version: zephyr-v3.1.0
92+
zephyr_sdk: 0.14.2
93+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION_linux-x86_64_minimal.tar.gz
94+
steps:
95+
- uses: actions/checkout@v2
96+
with:
97+
path: micro_ros_zephyr_module
98+
99+
- name: Dependencies
100+
shell: bash
101+
run: |
102+
apt update
103+
export DEBIAN_FRONTEND=noninteractive
104+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
105+
ccache dfu-util device-tree-compiler wget \
106+
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
107+
make gcc gcc-multilib g++-multilib libsdl2-dev
108+
pip3 install --user -U west
109+
export PATH=~/.local/bin:/github/home/.local/bin:"$PATH"
110+
west init zephyrproject
111+
cd zephyrproject
112+
cd zephyr
113+
git checkout ${{ matrix.zephyr_version }}
114+
cd ..
115+
west update
116+
west zephyr-export
117+
pip3 install --user -r zephyr/scripts/requirements.txt
118+
cd ..
119+
export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
120+
export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
121+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
122+
tar xvf $TOOLCHAIN_FILE_NAME
123+
cd zephyr-sdk-$TOOLCHAIN_VERSION
124+
./setup.sh -h -t arm-zephyr-eabi -c
125+
cd ..
126+
source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
127+
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
128+
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
129+
source zephyrproject/zephyr/zephyr-env.sh
130+
# Installing micro-ROS prerequisites
131+
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
73132
# Building the app
74133
west build -b disco_l475_iot1 micro_ros_zephyr_module

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# micro-ROS module for Zephyr
55

6-
This module has been tested in Zephyr RTOS v2.4.0 (SDK 0.11.4), v2.5.0 (SDK 0.11.4) and v2.6.0 (SDK 0.12.4).
6+
This module has been tested in Zephyr RTOS v2.5.0 (SDK 0.11.4), v2.6.0 (SDK 0.12.4), v2.7.0 (SDK 0.13.1) and v3.1.0 (SDK 0.14.2).
77

88
## Dependencies
99

modules/libmicroros/microros_transports/serial-usb/microros_transports.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ char uart_out_buffer[RING_BUF_SIZE];
2222

2323
struct ring_buf out_ringbuf, in_ringbuf;
2424

25-
static void uart_fifo_callback(struct device *dev){
25+
static void uart_fifo_callback(const struct device *dev, void * user_data){
2626
while (uart_irq_update(dev) && uart_irq_is_pending(dev)) {
2727
if (uart_irq_rx_ready(dev)) {
2828
int recv_len;
@@ -36,7 +36,7 @@ static void uart_fifo_callback(struct device *dev){
3636

3737
}
3838

39-
if (uart_irq_tx_ready(dev)) {
39+
if (uart_irq_tx_ready(dev)) {
4040
char buffer[64];
4141
int rb_len;
4242

@@ -58,12 +58,15 @@ bool zephyr_transport_open(struct uxrCustomTransport * transport){
5858
int ret;
5959
uint32_t baudrate, dtr = 0U;
6060

61-
params->uart_dev = device_get_binding("CDC_ACM_0");
61+
62+
// params->uart_dev = device_get_binding("CDC_ACM_0");
63+
params->uart_dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart);
64+
printk("uart_dev: %p\n", params->uart_dev);
6265
if (!params->uart_dev) {
6366
printk("CDC ACM device not found\n");
6467
return false;
6568
}
66-
69+
printk("CDC ACM device found: ready: %d\n", device_is_ready(params->uart_dev));
6770
ret = usb_enable(NULL);
6871
if (ret != 0) {
6972
printk("Failed to enable USB\n");
@@ -116,6 +119,7 @@ bool zephyr_transport_open(struct uxrCustomTransport * transport){
116119

117120
bool zephyr_transport_close(struct uxrCustomTransport * transport){
118121
zephyr_transport_params_t * params = (zephyr_transport_params_t*) transport->args;
122+
(void) params;
119123

120124
return true;
121125
}
@@ -124,15 +128,15 @@ size_t zephyr_transport_write(struct uxrCustomTransport* transport, const uint8_
124128
zephyr_transport_params_t * params = (zephyr_transport_params_t*) transport->args;
125129

126130
size_t wrote;
127-
131+
128132
wrote = ring_buf_put(&out_ringbuf, buf, len);
129-
133+
130134
uart_irq_tx_enable(params->uart_dev);
131135

132136
while (!ring_buf_is_empty(&out_ringbuf)){
133137
k_sleep(K_MSEC(5));
134138
}
135-
139+
136140
return wrote;
137141
}
138142

modules/libmicroros/microros_transports/serial-usb/microros_transports.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern "C"
2626

2727
typedef struct {
2828
size_t fd;
29-
struct device *uart_dev;
29+
const struct device *uart_dev;
3030
} zephyr_transport_params_t;
3131

3232
#define MICRO_ROS_FRAMING_REQUIRED true

prj.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ CONFIG_NEWLIB_LIBC_NANO=n
99
CONFIG_PTHREAD_IPC=n
1010

1111
CONFIG_POSIX_API=y
12-
CONFIG_NATIVE_POSIX_TIMER=y
1312
CONFIG_APP_LINK_WITH_POSIX_SUBSYS=y
1413
CONFIG_POSIX_CLOCK=y
1514

1615
CONFIG_STDOUT_CONSOLE=y
17-
CONFIG_USB=y
1816
CONFIG_USB_DEVICE_STACK=y
1917
CONFIG_USB_DEVICE_PRODUCT="Zephyr micro-ROS"
2018
CONFIG_LOG=y

src/main.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ void main(void)
4343
rcl_allocator_t allocator = rcl_get_default_allocator();
4444
rclc_support_t support;
4545

46-
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
47-
RCCHECK(rcl_init_options_init(&init_options, allocator));
48-
rmw_init_options_t* rmw_options = rcl_init_options_get_rmw_init_options(&init_options);
49-
5046
// create init_options
51-
RCCHECK(rclc_support_init_with_options(&support, 0, NULL, &init_options, &allocator));
47+
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
5248

5349
// create node
5450
rcl_node_t node;

0 commit comments

Comments
 (0)