Jump to content

Recommended Posts

Previously I indicated I was going to hunker down with a nice warm cup of MSP430FR2433, and I still love that chip & will keep it in reserve for future "small" projects, but it turns out I have a big project I need to tackle soon, particularly jarring since I'm not "in the zone" with MCU development & electronics, if you know what I mean.

I've heard somewhere around February 2022, AT&T is shutting down its 3G cell network in the USA - https://www.att.com/support/article/wireless/KM1324171/

Unfortunately many "connected" vehicles built in the past 10 years depend on 3G for their remote management features, not the least of which include both of my Ford electrified vehicles (2017 Ford Focus Electric, 2017 Ford C-Max Energi).

Ford has sent out a service notice to all their customers indicating they have 4G replacement modems available for these vehicles.  Ford will cover the labor for installation, however, the customer must buy the modem, and I haven't checked yet but others online state it's around $400.  The app you use to remotely manage the car changes, and the new app (FordPass) does not support many of the advanced features these EVs have (such as GO Times, a way to tell the car to preheat or pre-cool itself entirely using EV Charging Station power).


So you know where I'm going with this..... I need an OBD-II attached remote management platform.  I'm not sure if the diagnostic OBD-II port in the car gives me the kind of access I need, but I'm willing to replace the telematics control unit (modem) in the trunk and connect to its OBD-II bus if need be to get it going.  In any case, I want to build a board that can run off 12V, supports WiFi, and CAN bus.  I'm also just getting back into this game and want to make sure my platform is "widely supportable", and to me, that means Arduino.

It also means using off-the-shelf hardware that's easily available and less obscure than some of TI's offerings.  Also RPi has a certain amount of street cred in the maker market, so that's a plus.  I've decided to standardize on the RPi Pico and build a hardware platform around it.


Thus far I'm playing with this, an ESP8266 WiFi AT-command processor: https://www.waveshare.com/wiki/Pico-ESP8266

Writing software to properly manage AT commands in an Arduino C++ environment is a bit alien to me, and I haven't bothered going out looking for other libraries that support it; I want to write my own.  I want to use my own knowledge to perfect this top to bottom.  Eventually going to write, or rip off & modify, someone else's MCP2515 library for the CAN bus support (assuming that works; I do have a CAN bus boosterpack I designed which I could hotwire with jumper wires to test CAN bus out on the Pico, but eventually I want to build my own, and oh by the way, the "supply chain issues" have made CAN bus chips a bit hard to come by, but I have a small stash in my bins, so I'm going to use what I have here)

That said, I've already made some progress-


The default Pico "SerialUART" library in Arduino was crap and didn't employ either the ARM PrimeCell UART FIFOs or IRQs of any kind.  So I ripped it off & redid it- https://github.com/spirilis/PicoHWUART

I also wrote a Command CLI processor that uses a generic Stream object, such as a Serial port (genericized so in theory I could run this CLI over a TCP socket, through the ESP8266, once I have developed a high level Stream-implementing library to handle TCP connections over that stack).  https://github.com/spirilis/CommandInterface

Link to post
Share on other sites

For those following along, here's a few good links to bookmark:


RP2040 Datasheet: https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf

Pico datasheet (the board): https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf

RP2040 Hardware Design recs: https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf

Pico Pinout diagram: https://datasheets.raspberrypi.com/pico/Pico-R3-A4-Pinout.pdf

Earle Philower's Pico core for Arduino: https://github.com/earlephilhower/arduino-pico

Documentation for Earle's Pico core: https://arduino-pico.readthedocs.io/en/latest/


The RP2040 has an interesting programmable I/O controller called PIO.  Here's a video on it: 

It's also a DUAL CORE Cortex-M0+ that Arduino supports.  Here's a video on the dual core aspects: 





Link to post
Share on other sites

I'm also aware of this: https://www.tindie.com/products/invector/challenger-rp2040-lte/

RP2040 board with 4G LTE, that would be so nice.  I am going to try to make WiFi work for me for now though.  Key here is to have public wifi access points programmed in so it can "opportunistically" check in while on the go, if possible.  Otherwise just having it attach to my home wifi, which is on the opposite side of the basement wall from the driveway, is great for me.

Link to post
Share on other sites

Thank you for the pointer to the Challenger RP2040. It is nice to see the designers refrained from reinventing the wheel and took the Feather form-factor. Same for the LTE (SARA-R410M) or the WiFi radio (ESP8265).

The Raspberry Pi Pico RP2040 is a very good board and I strongly recommend the Earle Philower's Pico core for Arduino over the official Arduino mbed-based implementation.

There is a whole eco-system built around the Raspberry Pi Pico with many interesting kits. Let's me mention the E-Paper Display Pico Kit (EPDK), an all-in-one e-paper kit from Pervasive Displays.


Link to post
Share on other sites

I'll admit I'm a little embarrassed that I didn't look into other offerings, like the Feather.  Probably would've skipped the Pico.  Alas, I have 2 of them now so might as well proceed with what I have.

edit: Although, I see the Feather doesn't have castellated pins like the Pico and knockoffs do, so that's a factor.  Maybe not though.  Soldering castellated pins means you can't use the board space under the Pico for SMD parts, while through-hole gives you a small amount of clearance for some low-profile SMD parts.

Link to post
Share on other sites

That's great!  I bought a 2nd one expressedly for that purpose although I haven't used it yet (don't have my soldering equipment out of storage yet so the debug header isn't mounted yet).  Do you have any links or guides on how to use this with Arduino?  (does it come with GDB and is there a GUI or is it all CLI driven GDB usage?)

Link to post
Share on other sites

Forget the Arduino IDE! I would recommend using Visual Studio Code with the C/C++, Arduino and Cortex-Debug extensions.

The Raspberry Pi Pico acting as programmer-debugger is called Picoprobe. It also features redirection of the Serial1 port.

The installation process is detailed at the earlephilhower/arduino-pico page. You may need to build OpenOCD with specific options. It is easy and works fine.

Debugging is performed from Visual Studio Code. Obviously, you can use manual command-line GDB and OpenOCD. The only caveat is Serial1 should be used instead of Serial to print to the console.

Please find some pointers below.



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...