Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build dwm1001_desense example #10

Open
tuannv-github opened this issue Oct 6, 2020 · 4 comments
Open

Unable to build dwm1001_desense example #10

tuannv-github opened this issue Oct 6, 2020 · 4 comments

Comments

@tuannv-github
Copy link

tuannv-github commented Oct 6, 2020

newt target create dwm1001_desense
newt target set dwm1001_desense app=apps/desense
newt target set dwm1001_desense bsp=@decawave-uwb-core/hw/bsp/dwm1001
newt target set dwm1001_desense build_profile=debug
newt run dwm1001_desense 0

When I try to build the dwm1001_desense example with above commands, I ran into the following problem.

Compiling repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c
Error: repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c: In function 'send_test':
repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c:235:29: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
         printf("%s:%d TEST %"PRIu32"\n", __func__, __LINE__, desense->num_test_sent);
                             ^
repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c: In function 'rx_complete_cb':
repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c:507:70: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
                         printf("WARNING Error allocating memory for %"PRIu32" packets\n", req->test_params.n_test);
                                                                      ^
repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c: In function 'uwb_desense_pkg_init':
repos/decawave-uwb-core/lib/uwb_rf_tests/desense/src/desense.c:867:26: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
     printf("{\"utime\": %"PRIu32",\"msg\": \"uwb_desense_pkg_init\"}\n",
                          ^
cc1: all warnings being treated as errors

I know PRIu32 is used to print uint32_t, so these errors is strange.

@tuannv-github
Copy link
Author

tuannv-github commented Oct 6, 2020

I've seen that you have removed dwm1001_desense example recently. BTW, I wonder what could be the reasons.

@chepo92
Copy link

chepo92 commented Oct 8, 2020

I'm having the same error with twr_tag_tdma example

Error: repos/decawave-uwb-dw1000/hw/drivers/uwb/uwb_dw1000/src/dw1000_pkg.c: In function 'dw1000_pkg_down':
repos/decawave-uwb-dw1000/hw/drivers/uwb/uwb_dw1000/src/dw1000_pkg.c:99:13: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint32_t {aka long unsigned int}' [-Werror=format=]
     DIAGMSG("{\"utime\": %"PRIu32",\"msg\": \"dw1000_pkg_down\"}\n", dpl_cputime_ticks_to_usecs(dpl_cputime_get32()));
             ^
repos/decawave-uwb-dw1000/hw/drivers/uwb/uwb_dw1000/src/dw1000_pkg.c:44:29: note: in definition of macro 'DIAGMSG'
 #define DIAGMSG(s,u) printf(s,u)

@chepo92
Copy link

chepo92 commented Oct 8, 2020

Solved by running

repos/decawave-uwb-core/setup.sh
# Rerun newt install
newt install

and

cd repos/apache-mynewt-core/
git apply ../decawave-uwb-core/patches/apache-mynewt-core/mynewt_1_7_0_*

@tuannv-github
Copy link
Author

Solved by running

repos/decawave-uwb-core/setup.sh
# Rerun newt install
newt install

and

cd repos/apache-mynewt-core/
git apply ../decawave-uwb-core/patches/apache-mynewt-core/mynewt_1_7_0_*

Thanks. It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants