phdussud / pico-dirtyJtag

MIT License
276 stars 38 forks source link

Build error #1

Closed zoobab closed 3 years ago

zoobab commented 3 years ago

I am trying to build your firmware with pico-sdk, and I hit the following error:

[ 26%] Building C object CMakeFiles/dirtyJtag.dir/get_serial.c.obj
In file included from /code/pico-dirtyJtag/get_serial.c:27:
/code/pico-sdk/src/rp2_common/pico_unique_id/include/pico/unique_id.h:72:52: error: unknown type name 'uint'; did you mean 'int'?
   72 | void pico_get_unique_board_id_string(char *id_out, uint len);
      |                                                    ^~~~
      |                                                    int
make[2]: *** [CMakeFiles/dirtyJtag.dir/build.make:102: CMakeFiles/dirtyJtag.dir/get_serial.c.obj] Error 1
make[2]: Leaving directory '/code/pico-dirtyJtag/build'

I am using pico-sdk version 1.2.0 (bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7).

phdussud commented 3 years ago

Interesting. This error does not appear with an older (1.1) version of the SDK. We need a work around... Thanks, Patrick.


From: Benjamin Henrion @.> Sent: Saturday, June 5, 2021 3:44 AM To: phdussud/pico-dirtyJtag @.> Cc: Subscribed @.***> Subject: [phdussud/pico-dirtyJtag] Build error (#1)

I am trying to build your firmware with pico-sdk, and I hit the following error:

[ 26%] Building C object CMakeFiles/dirtyJtag.dir/get_serial.c.obj In file included from /code/pico-dirtyJtag/get_serial.c:27: /code/pico-sdk/src/rp2_common/pico_unique_id/include/pico/unique_id.h:72:52: error: unknown type name 'uint'; did you mean 'int'? 72 | void pico_get_unique_board_id_string(char *id_out, uint len); | ^~~~ | int make[2]: *** [CMakeFiles/dirtyJtag.dir/build.make:102: CMakeFiles/dirtyJtag.dir/get_serial.c.obj] Error 1 make[2]: Leaving directory '/code/pico-dirtyJtag/build'

I am using pico-sdk version 1.2.0 (bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fphdussud%2Fpico-dirtyJtag%2Fissues%2F1&data=04%7C01%7C%7C3ab9f895757d4ad1810708d9280ee09e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637584866619707595%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lAYBBHUNlq4PMaMD91MOTIXWkXLLoxXctPewfji31S4%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABVQKX2U3SB4IVL7GXA5NYLTRH5YLANCNFSM46EMOPDQ&data=04%7C01%7C%7C3ab9f895757d4ad1810708d9280ee09e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637584866619717552%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=EuAselzRBQuDKA6tIz0GBsvQGVX2IseHE%2FGKI%2BaiGys%3D&reserved=0.

phdussud commented 3 years ago

I think gcc does not define uint anymore. The fix would be to define it right before the failing include in get_serial.c like so(change in bold) typedef unsigned int uint;

include "pico/unique_id.h"

phdussud commented 3 years ago

I updated with the version 1.2 of the sdk and it builds with the change. I haven't tested the resulting binary yet.

phdussud commented 3 years ago

A better fix is to replace

include by #include "pico/types.h". This header file defined uint the same way I indicated.

This will give us:

include "pico/types.h"

include "pico/unique_id.h"

phdussud commented 3 years ago

I committed a fix.