jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 9:46 am

arg001 wrote:
Wed Nov 23, 2022 7:18 pm
Another minor point: people need to be reminded to read the RP2040 datasheet as well as the SDK documentation.

In some ways, the SDK doc does too good a job on some aspects (like PIO which duplicates a lot of the hardware documentation), which leads people to rely on it alone.

You often see threads on here where people can't figure things out, are given the answer and plaintively respond "but it doesn't tell you that in the documentation!", when in fact the critical info is in the RP2040 datasheet.

Conceptually, the RP2040 datasheet is "what the hardware can do for you", while the SDK guide is "how to get it to do that", but there's sufficient overlap that this isn't immediately obvious.
Already have that in there!
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 9:54 am

So, there have been a lot of comments on CMake, and I have written a load of stuff on that.

Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

User avatar
MikeDB
Posts: 1366
Joined: Sun Oct 12, 2014 8:27 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 10:19 am

jamesh wrote:
Thu Nov 24, 2022 9:54 am
So, there have been a lot of comments on CMake, and I have written a load of stuff on that.

Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
Developing on Windows using SDK

Using Mbed on the Pico

Using Clang

Minimising power consumption

... and finish off some of the half-finished examples that are in another folder that gets downloaded in the toolkit
Always interested in innovative audio startups needing help and investment. Look for InPoSe Ltd or Future Horizons on LinkedIn to find me (same avatar photograph)

MatSOBDev
Posts: 126
Joined: Wed Jul 06, 2022 7:25 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 10:42 am

MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Minimising power consumption
Maybe not a right thread, but dual voltage DC-DC converter or second smaller one, with high efficiency at low loads for supplying core would be nice to have aboard.I would like to have that more than header and SWD connector. Maybe Pico DC for a name :D
Last edited by MatSOBDev on Thu Nov 24, 2022 10:45 am, edited 1 time in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 11:02 am

MatSOBDev wrote:
Thu Nov 24, 2022 10:42 am
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Minimising power consumption
Maybe not a right thread, but dual voltage DC-DC converter or second smaller one, with high efficiency at low loads for supplying core would be nice to have aboard.I would like to have that more than header and SWD connector. Maybe Pico DC for a name :D
You can buy the RP2040 and make your own board for this. Might even be one already out there. Remember the Pico is a dev board first and foremost.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

MatSOBDev
Posts: 126
Joined: Wed Jul 06, 2022 7:25 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 11:25 am

So maybe Pico W DC, if it has all the certificates to be in commercial use. Pico as a development platform foremost should give all GPIO of RP2040 lacking or providing way of disconnection for features like VBUS sensing, VSYS measuring. In this case multiple power source - on board, direct 3.3V should be nice. nRF DEV Kits are not approved for resale for example.
Last edited by MatSOBDev on Thu Nov 24, 2022 12:57 pm, edited 1 time in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 11:29 am

MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Developing on Windows using SDK
Being dealt with elsewhere
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Using Mbed on the Pico
Rather more involved than beginners hints and tips I suspect.
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Using Clang
Looking in to this, but might require a load of work that I don't have time for.
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Minimising power consumption
This will be covered in another paper
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
... and finish off some of the half-finished examples that are in another folder that gets downloaded in the toolkit
Not in the remit of this document.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 1:20 pm

off topic:

Had a play with Clang, and although its fairly easy to get the system to use it, the SDK itself throws some compile errors that I do not have time to dig in to and fix (and some are ARM assembler which I am not familiar with anyway). So that will have to wait until the SDK is fixed up.

For those who want to try it

sudo apt install clang ldd

Edit <sdk>/cmake/preload/toolchains/pico_arm_clang.cmake

Change the references to llvm-objcopy and llvm-objdump to llvm-objcopy-11 and llvm-objdump-11

Note the number of the end will depend on the versions installed which is system dependant. Latest Pi OS distro is 11 as above, ubuntu is 14 which is what I tested on.

cmake -DPICO_COMPILER=pico_arm_clang ..

Then run make. I get warnings then a couple of errors which stop compilation.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

pidd
Posts: 4153
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 2:00 pm

jamesh wrote:
Thu Nov 24, 2022 9:54 am
Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
Something that crops up very regularly is the different ways to obtain consistent timing (generation or measurement). And frequency limitations.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 2:07 pm

pidd wrote:
Thu Nov 24, 2022 2:00 pm
jamesh wrote:
Thu Nov 24, 2022 9:54 am
Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
Something that crops up very regularly is the different ways to obtain consistent timing (generation or measurement). And frequency limitations.
Can you explain what you mean by these?
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

hippy
Posts: 12693
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 2:23 pm

jamesh wrote:
Thu Nov 24, 2022 9:54 am
Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
Perhaps needing more than just hints and tips, but file system support for Pico SDK C programs and integration with 'fopen' et al, is something currently missing though I believe may be on the roadmap.

hippy
Posts: 12693
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:31 pm

jamesh wrote:
Thu Nov 24, 2022 1:20 pm
Had a play with Clang, and although its fairly easy to get the system to use it, the SDK itself throws some compile errors that I do not have time to dig in to and fix (and some are ARM assembler which I am not familiar with anyway). So that will have to wait until the SDK is fixed up.
Thanks for that. I have a fix for the assembler issue. Because it's off-topic I have included that fix and continued the topic in my previous Clang thread - viewtopic.php?p=2057000#p2057000

User avatar
MikeDB
Posts: 1366
Joined: Sun Oct 12, 2014 8:27 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:36 pm

jamesh wrote:
Thu Nov 24, 2022 11:29 am
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Using Mbed on the Pico
Rather more involved than beginners hints and tips I suspect.
Agreed. I thought you were looking for idea moving beyond beginners and obviously using Mbed easily is one area commercial users would like to see as it puts the RP2040 squarely in the same ballpark as other vendor's MCUs.
Always interested in innovative audio startups needing help and investment. Look for InPoSe Ltd or Future Horizons on LinkedIn to find me (same avatar photograph)

User avatar
MikeDB
Posts: 1366
Joined: Sun Oct 12, 2014 8:27 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:39 pm

MatSOBDev wrote:
Thu Nov 24, 2022 10:42 am
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Minimising power consumption
Maybe not a right thread, but dual voltage DC-DC converter or second smaller one, with high efficiency at low loads for supplying core would be nice to have aboard.I would like to have that more than header and SWD connector. Maybe Pico DC for a name :D
I was thinking more of the software aspects - how to turn the core into lowest power mode and wake it up quickly, switching to use the internal clock, throttling back the clock speed and all the other tricks a beginner may not be aware of.
Always interested in innovative audio startups needing help and investment. Look for InPoSe Ltd or Future Horizons on LinkedIn to find me (same avatar photograph)

kilograham
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1340
Joined: Fri Apr 12, 2019 11:00 am
Location: austin tx

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:46 pm

MikeDB wrote:
Thu Nov 24, 2022 10:19 am

Using Clang
Officlal Clang support will be included in a subsequent SDK version.

slimhazard
Posts: 219
Joined: Sat Apr 03, 2021 8:47 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:48 pm

jamesh wrote:
Thu Nov 24, 2022 9:54 am
Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
There's something that fits this description, although certainly not in the remit of the document. I've been back & forth as to whether to bring it up at all, but at some point it needs to be said.

The SDK depends strongly on two third-party libraries, tinyusb and lwIP. To try to express this in a generous way, the Pico and SDK documentation is outstanding, whereas the documentation for those two libraries does not meet the same standard.

Or to state it more plainly: the software/API docs for the two projects are among the worst of the genre that I've ever seen.

Yes, I know. Those docs are the responsibility of the two projects, not of anyone at Raspberry Pi, and jamesh and his document can't do much to change the situation. Yes, they are open-source projects contributed by volunteers, squeezed for time and underfunded like so many others. I know.

But if you ask me where I have needed better documentation while developing with the SDK, that has been far and away the most severe problem.

To repeat, it's clear to me that the team responsible for the Pico and the SDK and its documentation can't do much about it. And while I know nothing at all about the means available to Raspberry Pi Foundation, it occurs to me that a donation by the charity to the two projects, so that they can bring their docs up to at least a minimal standard, could conceivably be one of the best things that ever happened to the SDK.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:57 pm

MikeDB wrote:
Thu Nov 24, 2022 3:36 pm
jamesh wrote:
Thu Nov 24, 2022 11:29 am
MikeDB wrote:
Thu Nov 24, 2022 10:19 am
Using Mbed on the Pico
Rather more involved than beginners hints and tips I suspect.
Agreed. I thought you were looking for idea moving beyond beginners and obviously using Mbed easily is one area commercial users would like to see as it puts the RP2040 squarely in the same ballpark as other vendor's MCUs.
Only just beyond beginners...if you go much further the prospective work space gets too large and starts to end up in individual document territory.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 3:57 pm

slimhazard wrote:
Thu Nov 24, 2022 3:48 pm
jamesh wrote:
Thu Nov 24, 2022 9:54 am
Now I am looking for other areas when developing for the Pico that would benefit from hints and tips.
There's something that fits this description, although certainly not in the remit of the document. I've been back & forth as to whether to bring it up at all, but at some point it needs to be said.

The SDK depends strongly on two third-party libraries, tinyusb and lwIP. To try to express this in a generous way, the Pico and SDK documentation is outstanding, whereas the documentation for those two libraries does not meet the same standard.

Or to state it more plainly: the software/API docs for the two projects are among the worst of the genre that I've ever seen.

Yes, I know. Those docs are the responsibility of the two projects, not of anyone at Raspberry Pi, and jamesh and his document can't do much to change the situation. Yes, they are open-source projects contributed by volunteers, squeezed for time and underfunded like so many others. I know.

But if you ask me where I have needed better documentation while developing with the SDK, that has been far and away the most severe problem.

To repeat, it's clear to me that the team responsible for the Pico and the SDK and its documentation can't do much about it. And while I know nothing at all about the means available to Raspberry Pi Foundation, it occurs to me that a donation by the charity to the two projects, so that they can bring their docs up to at least a minimal standard, could conceivably be one of the best things that ever happened to the SDK.
Interesting point. Not sure what to do about that!
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

hippy
Posts: 12693
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 4:24 pm

slimhazard wrote:
Thu Nov 24, 2022 3:48 pm
To repeat, it's clear to me that the team responsible for the Pico and the SDK and its documentation can't do much about it. And while I know nothing at all about the means available to Raspberry Pi Foundation, it occurs to me that a donation by the charity to the two projects, so that they can bring their docs up to at least a minimal standard, could conceivably be one of the best things that ever happened to the SDK.
It seems to me it is more a matter for Raspberry Pi Ltd to deal with rather than the Foundation.

slimhazard
Posts: 219
Joined: Sat Apr 03, 2021 8:47 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 4:37 pm

hippy wrote:
Thu Nov 24, 2022 4:24 pm
It seems to me it is more a matter for Raspberry Pi Ltd to deal with rather than the Foundation.
I'll assume that you're right, since I am nothing if not confused about all that. The reasoning goes like:
  • The two projects come up short where documentation is concerned, because it's all volunteer work (I believe I read one of the lwIP devs saying that precisely that is the problem).
  • They're always asking for donations, so that they can set aside the time to work on efforts such as better documentation.
  • Raspberry Pi Something Something may be able to make a contribution for that purpose (he said not actually knowing how any of that works).
  • The result could be greatly beneficial for the SDK.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 5:29 pm

slimhazard wrote:
Thu Nov 24, 2022 4:37 pm
hippy wrote:
Thu Nov 24, 2022 4:24 pm
It seems to me it is more a matter for Raspberry Pi Ltd to deal with rather than the Foundation.
I'll assume that you're right, since I am nothing if not confused about all that. The reasoning goes like:
  • The two projects come up short where documentation is concerned, because it's all volunteer work (I believe I read one of the lwIP devs saying that precisely that is the problem).
  • They're always asking for donations, so that they can set aside the time to work on efforts such as better documentation.
  • Raspberry Pi Something Something may be able to make a contribution for that purpose (he said not actually knowing how any of that works).
  • The result could be greatly beneficial for the SDK.
Not disagreeing. Just wondering if that is something we would do. I'll propose it to the boss.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

User avatar
MikeDB
Posts: 1366
Joined: Sun Oct 12, 2014 8:27 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 8:47 pm

jamesh wrote:
Thu Nov 24, 2022 3:57 pm
MikeDB wrote:
Thu Nov 24, 2022 3:36 pm
Agreed. I thought you were looking for idea moving beyond beginners and obviously using Mbed easily is one area commercial users would like to see as it puts the RP2040 squarely in the same ballpark as other vendor's MCUs.
Only just beyond beginners...if you go much further the prospective work space gets too large and starts to end up in individual document territory.
Okay. But Mbed is as near as you get to an industry standard in commercial MCUs, much as Arduino is in the hobbyist and builder domain.
Always interested in innovative audio startups needing help and investment. Look for InPoSe Ltd or Future Horizons on LinkedIn to find me (same avatar photograph)

User avatar
MikeDB
Posts: 1366
Joined: Sun Oct 12, 2014 8:27 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 8:51 pm

jamesh wrote:
Thu Nov 24, 2022 5:29 pm
slimhazard wrote:
Thu Nov 24, 2022 4:37 pm
  • The two projects come up short where documentation is concerned, because it's all volunteer work (I believe I read one of the lwIP devs saying that precisely that is the problem).
  • They're always asking for donations, so that they can set aside the time to work on efforts such as better documentation.
  • Raspberry Pi Something Something may be able to make a contribution for that purpose (he said not actually knowing how any of that works).
  • The result could be greatly beneficial for the SDK.
Not disagreeing. Just wondering if that is something we would do. I'll propose it to the boss.
But make sure you get value for money and something that works. I don't think you did with that balanced line feature in Kicad you paid for.
Always interested in innovative audio startups needing help and investment. Look for InPoSe Ltd or Future Horizons on LinkedIn to find me (same avatar photograph)

dthacher
Posts: 510
Joined: Sun Jun 06, 2021 12:07 am

Re: Some input needed on a document to help beginers with Pico

Thu Nov 24, 2022 9:37 pm

Lets keep the PICO in the hobbyist and builder domain. Lets also see if we can do better than Arduino in teaching people how controllers work. Particularly 32-bit controllers since the RP2040 is goofy. Can we keep the arrogance I see from the foundation out too?

The RP2040 is capable of competing against many Cortex-M microcontrollers for commercial applications. However power and critical safety are not the priority for this. Many of these are possible, however only a few microcontrollers in the Cortex-M implement this... Cortex-R is actually used in many of these cases.

Believe it or not the RP2040 is still very powerful on M0+ (32 interrupt NVIC, von Nuemann, weak ISA, etc.) using XIP. It would be really nice if people had a means of learning this. This is not something you will learn in a couple hours.

The power consumption is actually somewhat decent. For commercial it is not likely as good for either one compared to other offerings. It is still capable of working on coin cell and AAA using low clock speed. It cannot benefit from newer batteries as much, however these are usually larger in capacity. This is due to sleep power being a little high.

If you wanted to do a full tutorial on microcontrollers, technically the UMA architecture is abnormal for commercial usage. CMake is important so is ARM software support. It would be good to understand that. The clock and peripherals are mostly smoothed out with PIO, which may not work in all cases. However it is a 125MHz dual core with 264K of RAM for 70 cents! (For a M0+ 264K is enough for both cores to have flash and RAM in RAM.)

XIP is for reading not writing, this would be one pitfall that is made a lot. Use external flash for writing.
There is more I could say here but I am going to leave it at this. Till the world is not a complete waste of time.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31811
Joined: Sat Jul 30, 2011 7:41 pm

Re: Some input needed on a document to help beginers with Pico

Fri Nov 25, 2022 7:59 am

dthacher wrote:
Thu Nov 24, 2022 9:37 pm
Lets keep the PICO in the hobbyist and builder domain. Lets also see if we can do better than Arduino in teaching people how controllers work. Particularly 32-bit controllers since the RP2040 is goofy. Can we keep the arrogance I see from the foundation out too?

The RP2040 is capable of competing against many Cortex-M microcontrollers for commercial applications. However power and critical safety are not the priority for this. Many of these are possible, however only a few microcontrollers in the Cortex-M implement this... Cortex-R is actually used in many of these cases.

Believe it or not the RP2040 is still very powerful on M0+ (32 interrupt NVIC, von Nuemann, weak ISA, etc.) using XIP. It would be really nice if people had a means of learning this. This is not something you will learn in a couple hours.

The power consumption is actually somewhat decent. For commercial it is not likely as good for either one compared to other offerings. It is still capable of working on coin cell and AAA using low clock speed. It cannot benefit from newer batteries as much, however these are usually larger in capacity. This is due to sleep power being a little high.

If you wanted to do a full tutorial on microcontrollers, technically the UMA architecture is abnormal for commercial usage. CMake is important so is ARM software support. It would be good to understand that. The clock and peripherals are mostly smoothed out with PIO, which may not work in all cases. However it is a 125MHz dual core with 264K of RAM for 70 cents! (For a M0+ 264K is enough for both cores to have flash and RAM in RAM.)

XIP is for reading not writing, this would be one pitfall that is made a lot. Use exter nal flash for writing.
What on earth does this have to do with the topic? Nothing. Please keep to the subject.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Return to “SDK”