analogRead(?) not up to par in board BSP V2.2.0 but Works in BSP v1.2.1

I find the latest version of the Artemis RedBoard analogRread(x) fails on anything but A0. Using A1 through A4 returns 0

as stated in other topics. The pin mapping functions seem to not find the right pin so a 0 is returned as a result.

I found in another older post where someone went back to BSP v1.2.1 and the A0,A1,A2 as arguments to analogRead

does work. All along the claim is that the Artemis libraries are 90% compatible with older Uno like sketches.

Has anyone found this problem with the latest Artemis BSP V2.2.0? I would think so, this is the most common thing

we do with our Arduino boards, read A/D an output messages and lights, etc. Any work around or easy fixes, would

be much appreciated.

While I muddled through much of the MBED code and AMicro stuff, see things that would contribute to problems but

haven’t figured out where the issue is in 2.2.0. It appears that V1.2.1 does not use MBED code so much and works for me,

until I need some other advanced feature (like BLE) and will bump into bugs that it had and the many reasons why the

version is 2.2.0 today. Was “regression testing” done as this BSP evolved?

This is because of an incomplete pin definition.

In the library folder: ’ …/apollo3/2.2.0/variants/SFE_ARTEMIS/config’ (the exact location of your library depends whether you run on Windows or Linux or what…) there is a file called pins.cpp.

Replace that with the attached updated file (the old content is still there but commented out). It should do the trick.

pins.cpp (2.24 KB)

Thanks Paul, you must have gone through this same thing. Aren’t the Forums great for answers.

I had walked through the 2.2.0 files but not picked up on the error yet, so I down graded and that

worked. I would have spent much time diff’ing those two BSPs to find this as a difference. You

saved me more time after spending plenty on the issue. The Cortex M4F is fantastic and I have

already worked through similar issues on the TI CC2652R1 CPU and it’s pin tables and all the places

one has to visit in their BSP’s to define pins for a custom board. I kind of felt that there would be

a similar issue with the same CPU in a different environment as the Redboard.

But great, fellow programmer support saved time and effort for me and maybe others!

Maybe the answer was out there and I somehow missed it.

Cheers,

Marc Y.