micro-ROS / micro_ros_zephyr_module

micro-ROS Zephyr module and sample code
Apache License 2.0
46 stars 22 forks source link

boards: move board specific configurations #63

Closed uLipe closed 1 year ago

uLipe commented 1 year ago

Te idea is to keep consistent with other zephyr modules and separate board specific details into their own overlays.

Also add the example l475 IoT discovery board as an example.

No changes in the environment or build.

uLipe commented 1 year ago

@pablogs9 @Acuadros95 PTAL.

pablogs9 commented 1 year ago

Running CI, thanks a lot @uLipe

pablogs9 commented 1 year ago

@mergify backport foxy galactic main

mergify[bot] commented 1 year ago

backport foxy galactic main

✅ Backports have been created

* [#76 boards: move board specific configurations (backport #63)](https://github.com/micro-ROS/micro_ros_zephyr_module/pull/76) has been created for branch `foxy` * [#77 boards: move board specific configurations (backport #63)](https://github.com/micro-ROS/micro_ros_zephyr_module/pull/77) has been created for branch `galactic` * [#78 boards: move board specific configurations (backport #63)](https://github.com/micro-ROS/micro_ros_zephyr_module/pull/78) has been created for branch `main`
pablogs9 commented 1 year ago

It seems to break the CI @uLipe : https://github.com/micro-ROS/micro_ros_zephyr_module/runs/7534484810?check_suite_focus=true#step:4:5888

uLipe commented 1 year ago

@pablogs9 my bad, during rebase I dropped a piece of the dts I will change this to draft while I fix it

uLipe commented 1 year ago

It seems the problem is more complex, the ucd node was introduced from zephyr version 2.7 , which is on my env for now.

For now I will make this compatible with 2.6 and figure later how to make the things to be compatible across the RTOS versions

pablogs9 commented 1 year ago

Thanks. Maybe we should investigate the working status of this module in 2.7 @Acuadros95

uLipe commented 1 year ago

@pablogs9 PTAL again, for now let's keep compatible with 2.6.

Actually I have this running on Zephyr 3.1 but using the overlay + kconfig updates that broke the CI + this PR https://github.com/ros2/rcutils/pull/368

pablogs9 commented 1 year ago

Could you take a look at this https://github.com/micro-ROS/micro_ros_zephyr_module/pull/64 @uLipe. We would like to have this working with v3.1.0 as you have.

uLipe commented 1 year ago

@pablogs9 , @Acuadros95 , I just took the opportunity to modify the zephyr transport serial port to use the DT macros, label property in the devices are being removed from Zephyr and will not work in future kernel releases.

Please take another review and ask me any questions you might to have.

pablogs9 commented 1 year ago

I'll take a look on Monday when I have some hardware in the office

pablogs9 commented 1 year ago

Hello @uLipe:

uLipe commented 1 year ago

Hi @pablogs9 my bad, I forgot to push the serial to usb commit to the PR will do it later and you will be able to test.

uLipe commented 1 year ago

@pablogs9 PTAL again, you may able to build serial usb now

uLipe commented 1 year ago

Hi @pablogs9 any updates regarding your tests?

About the Zephyr version I think it is safe to drop the 2.4 support, since most of V2 users would go to version 2.6 or 2.7, the last one is a LTS version.

There is no Zephyr-API breaking changes across 2.4 to 2.7, the same is not true for the build system for example, depending on what changed in a particular subsystem.

pablogs9 commented 1 year ago

Hello @uLipe, I'll check this on Monday in the office, because I have no boards right now.

Meanwhile, I would like to drop 2.4 and add 2.7 in this PR: https://github.com/micro-ROS/micro_ros_zephyr_module/pull/64 is it possible for you to take a look there?

pablogs9 commented 1 year ago

Hello @uLipe, I have been able to build the USB example but I have the following error:

*** Booting Zephyr OS build v2.6.0-rc1  ***
Failed to enable USB

Any idea? I'm working in the disco_l475_iot1

uLipe commented 1 year ago

What is the ERRNO @pablogs9 ? Have you tried in a different board like that?

pablogs9 commented 1 year ago

That's our reference board for Zephyr, not sure if I have other. errno is 0 (?!?!)

    ret = usb_enable(NULL);
    if (ret != 0) {
        printk("Failed to enable USB %d\n",errno);
        return false;
    }

result in

*** Booting Zephyr OS build v2.6.0-rc1  ***
Failed to enable USB 0
uLipe commented 1 year ago

actually ret comes with the error code translated into errno code, could you print ret instead?

My board currently opens and attches to the usb correctly.

pablogs9 commented 1 year ago
    ret = usb_enable(NULL);
    if (ret != 0) {
        printk("Failed to enable USB %d\n", ret);
        return false;
    }

results in

*** Booting Zephyr OS build v2.6.0-rc1  ***
Failed to enable USB -5

Any idea?

pablogs9 commented 1 year ago

I have been testing samples/subsys/usb/cdc_acm with my board and I have:

*** Booting Zephyr OS build zephyr-v3.1.0  ***
[00:00:00.034,000] <err> usb_dc_stm32: PCD_Init failed, 1
[00:00:00.034,000] <err> cdc_acm_echo: Failed to enable USB

This does not seems like a micro-ROS transport problem.

pablogs9 commented 1 year ago

@uLipe I have updated the support here: https://github.com/micro-ROS/micro_ros_zephyr_module/pull/64: now we support the latest v2.x version and the latest v3.x version.

Please rebase this PR and we can merge since my USB-CDC problems are not related

BTW I have backported https://github.com/ros2/rcutils/pull/368 to foxy, humble and galactic in the micro-ROS fork. Are you aware of this being backported in the mainline?

uLipe commented 1 year ago

@pablogs9 sure, I will do that late here, and re-request your review.

uLipe commented 1 year ago

@pablogs9 btw the error you re receiving is a timeout that is coming from USB endopoint, code 5 is -EIO, which is generated by the CDC ACM class when starting endpoint sending and no notification about the write is read back, are the connections, cable ot host computer okay? Do you see the enumeration on your host?

uLipe commented 1 year ago

@pablogs9 rebase, please check one more time.

uLipe commented 1 year ago

@pablogs9 fixed the changelog, please do a check again.

Acuadros95 commented 1 year ago

@uLipe Could you take a look at the CI? detail

/__w/micro_ros_zephyr_module/micro_ros_zephyr_module/micro_ros_zephyr_module/boards/disco_l475_iot1.conf:1: warning: attempt to assign the value 'y' to the undefined symbol USB
...

error: Aborting due to Kconfig warnings
uLipe commented 1 year ago

@pablogs9 sorry for the delay, since we dropped the version 2.6 the CONFIG_USB symbol was also deprecated, I will remove it and update the PR

uLipe commented 1 year ago

@pablogs9 @Acuadros95 I added the Zephyr UDC0 nodelabel, which replaces the CONFIG_USB from version 2.7 and above, please approve the workflow when you have time.

pablogs9 commented 1 year ago

@Acuadros95 PTAL and merger if you are ok