Skip to content

Commit 1a53d78

Browse files
pablogs9mergify[bot]
authored andcommitted
Move support to v2.7.x and v3.1.0 (#64)
* Add v2.7.0 and v3.1.0 Signed-off-by: Pablo Garrido <[email protected]> Fix Signed-off-by: Pablo Garrido <[email protected]> Fix Signed-off-by: Pablo Garrido <[email protected]> Use ubuntu 20.04 Signed-off-by: Pablo Garrido <[email protected]> Update cmake Signed-off-by: Pablo Garrido <[email protected]> Fix env Signed-off-by: Pablo Garrido <[email protected]> Fix Signed-off-by: Pablo Garrido <[email protected]> Deprecate v2.4.0 Signed-off-by: Pablo Garrido <[email protected]> Update Signed-off-by: Pablo Garrido <[email protected]> Update Readme Signed-off-by: Pablo Garrido <[email protected]> Fix CMake Signed-off-by: Pablo Garrido <[email protected]> Update Signed-off-by: Pablo Garrido <[email protected]> * Revert "Add v2.7.0 and v3.1.0" This reverts commit 64370f1. * Initial Signed-off-by: Pablo Garrido <[email protected]> * Update Signed-off-by: Pablo Garrido <[email protected]> * Update Signed-off-by: Pablo Garrido <[email protected]> * Fix Signed-off-by: Pablo Garrido <[email protected]> * Move 2.7.2 to new ci Signed-off-by: Pablo Garrido <[email protected]> * Deprecate <v2.7 Signed-off-by: Pablo Garrido <[email protected]> * Readme Signed-off-by: Pablo Garrido <[email protected]> (cherry picked from commit 07797df) # Conflicts: # .github/workflows/ci.yml # .github/workflows/nightly.yml # README.md
1 parent 0b73435 commit 1a53d78

File tree

7 files changed

+59
-32
lines changed

7 files changed

+59
-32
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ 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+
<<<<<<< HEAD
1617
zephyr_version: ["zephyr-v2.4.0", "zephyr-v2.5.0", "v2.6.0-rc1"]
1718
include:
1819
- zephyr_version: zephyr-v2.4.0
@@ -24,6 +25,16 @@ jobs:
2425
- zephyr_version: v2.6.0-rc1
2526
zephyr_sdk: 0.12.4
2627
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-x86_64-linux-setup.run
28+
=======
29+
zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
30+
include:
31+
- zephyr_version: zephyr-v2.7.2
32+
zephyr_sdk: 0.14.2
33+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
34+
- zephyr_version: zephyr-v3.1.0
35+
zephyr_sdk: 0.14.2
36+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
37+
>>>>>>> 07797df (Move support to v2.7.x and v3.1.0 (#64))
2738
steps:
2839
- uses: actions/checkout@v2
2940
with:
@@ -34,8 +45,8 @@ jobs:
3445
run: |
3546
apt update
3647
export DEBIAN_FRONTEND=noninteractive
37-
apt install -y --no-install-recommends git cmake ninja-build gperf \
38-
ccache dfu-util device-tree-compiler wget curl gnupg2 \
48+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
49+
ccache dfu-util device-tree-compiler wget \
3950
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
4051
make gcc gcc-multilib g++-multilib libsdl2-dev
4152
pip3 install --user -U west
@@ -52,15 +63,15 @@ jobs:
5263
export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
5364
export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
5465
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
55-
chmod +x $TOOLCHAIN_FILE_NAME
56-
yes | ./$TOOLCHAIN_FILE_NAME -- -rc -y -d $(pwd)/zephyr-sdk || :
57-
rm -rf $TOOLCHAIN_FILE_NAME
66+
tar xvf $TOOLCHAIN_FILE_NAME
67+
cd zephyr-sdk-$TOOLCHAIN_VERSION
68+
./setup.sh -h -t arm-zephyr-eabi -c
69+
cd ..
70+
source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
5871
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
59-
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk
72+
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
6073
source zephyrproject/zephyr/zephyr-env.sh
6174
# Installing micro-ROS prerequisites
6275
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
6576
# Building the app
6677
west build -b disco_l475_iot1 micro_ros_zephyr_module

.github/workflows/nightly.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,23 @@ 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+
<<<<<<< HEAD
1920
zephyr_version: ["zephyr-v2.4.0", "zephyr-v2.5.0", "v2.6.0-rc1"]
2021
distro: ["foxy", "rolling"]
22+
=======
23+
zephyr_version: ["zephyr-v3.1.0", "zephyr-v2.7.2"]
24+
distro: ["foxy", "humble", "rolling"]
25+
>>>>>>> 07797df (Move support to v2.7.x and v3.1.0 (#64))
2126
include:
2227
- distro: foxy
2328
branch: foxy
2429
- distro: rolling
2530
branch: main
31+
<<<<<<< HEAD
2632
- zephyr_version: zephyr-v2.4.0
2733
zephyr_sdk: 0.11.4
2834
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-setup.run
@@ -32,18 +38,28 @@ jobs:
3238
- zephyr_version: v2.6.0-rc1
3339
zephyr_sdk: 0.12.4
3440
sdk_filename: zephyr-toolchain-arm-$TOOLCHAIN_VERSION-x86_64-linux-setup.run
41+
=======
42+
- distro: humble
43+
branch: humble
44+
- zephyr_version: zephyr-v2.7.2
45+
zephyr_sdk: 0.14.2
46+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION\_linux-x86_64_minimal.tar.gz
47+
- zephyr_version: zephyr-v3.1.0
48+
zephyr_sdk: 0.14.2
49+
sdk_filename: zephyr-sdk-$TOOLCHAIN_VERSION_linux-x86_64_minimal.tar.gz
50+
>>>>>>> 07797df (Move support to v2.7.x and v3.1.0 (#64))
3551
steps:
3652
- uses: actions/checkout@v2
3753
with:
3854
path: micro_ros_zephyr_module
39-
ref: ${{ matrix.branch }}
55+
4056
- name: Dependencies
4157
shell: bash
4258
run: |
4359
apt update
4460
export DEBIAN_FRONTEND=noninteractive
45-
apt install -y --no-install-recommends git cmake ninja-build gperf \
46-
ccache dfu-util device-tree-compiler wget curl gnupg2 \
61+
apt install -y --no-install-recommends wget git cmake ninja-build gperf \
62+
ccache dfu-util device-tree-compiler wget \
4763
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
4864
make gcc gcc-multilib g++-multilib libsdl2-dev
4965
pip3 install --user -U west
@@ -60,15 +76,15 @@ jobs:
6076
export TOOLCHAIN_VERSION=${{ matrix.zephyr_sdk }}
6177
export TOOLCHAIN_FILE_NAME=${{ matrix.sdk_filename }}
6278
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$TOOLCHAIN_VERSION/$TOOLCHAIN_FILE_NAME
63-
chmod +x $TOOLCHAIN_FILE_NAME
64-
yes | ./$TOOLCHAIN_FILE_NAME -- -rc -y -d $(pwd)/zephyr-sdk || :
65-
rm -rf $TOOLCHAIN_FILE_NAME
79+
tar xvf $TOOLCHAIN_FILE_NAME
80+
cd zephyr-sdk-$TOOLCHAIN_VERSION
81+
./setup.sh -h -t arm-zephyr-eabi -c
82+
cd ..
83+
source zephyr-sdk-$TOOLCHAIN_VERSION/environment-setup-x86_64-pokysdk-linux
6684
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
67-
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk
85+
export ZEPHYR_SDK_INSTALL_DIR=$(pwd)/zephyr-sdk-$TOOLCHAIN_VERSION
6886
source zephyrproject/zephyr/zephyr-env.sh
6987
# Installing micro-ROS prerequisites
7088
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
7389
# Building the app
7490
west build -b disco_l475_iot1 micro_ros_zephyr_module

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
# micro-ROS module for Zephyr
55

6+
<<<<<<< HEAD
67
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).
8+
=======
9+
This module has been tested in Zephyr RTOS v2.7.0 (SDK 0.14.2) and v3.1.0 (SDK 0.14.2).
10+
>>>>>>> 07797df (Move support to v2.7.x and v3.1.0 (#64))
711
812
## Dependencies
913

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

Lines changed: 7 additions & 5 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,6 +58,7 @@ bool zephyr_transport_open(struct uxrCustomTransport * transport){
5858
int ret;
5959
uint32_t baudrate, dtr = 0U;
6060

61+
6162
params->uart_dev = device_get_binding("CDC_ACM_0");
6263
if (!params->uart_dev) {
6364
printk("CDC ACM device not found\n");
@@ -116,6 +117,7 @@ bool zephyr_transport_open(struct uxrCustomTransport * transport){
116117

117118
bool zephyr_transport_close(struct uxrCustomTransport * transport){
118119
zephyr_transport_params_t * params = (zephyr_transport_params_t*) transport->args;
120+
(void) params;
119121

120122
return true;
121123
}
@@ -124,15 +126,15 @@ size_t zephyr_transport_write(struct uxrCustomTransport* transport, const uint8_
124126
zephyr_transport_params_t * params = (zephyr_transport_params_t*) transport->args;
125127

126128
size_t wrote;
127-
129+
128130
wrote = ring_buf_put(&out_ringbuf, buf, len);
129-
131+
130132
uart_irq_tx_enable(params->uart_dev);
131133

132134
while (!ring_buf_is_empty(&out_ringbuf)){
133135
k_sleep(K_MSEC(5));
134136
}
135-
137+
136138
return wrote;
137139
}
138140

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)