Need help replicating RP2040 w/o WiFi chip

I'm designing a product that has been using the Arduino module, RP2040 Connect. But it is not the form factor I need and I don't need WiFi or the other functions. The trouble is the signals A4-A7 are handled by the WiFi chip. How can I adapt the code so that I can use free GPIO pins on the 2040 chip?

If you provide the code in code tags, and a hand drawn circuit diagram maybe someone can help.

I don't even know where I can find the existing code. But I need to make sure that the SDA and SCL signals are properly handled and that I can assign the A6 and A7 signals to GPIO pins on the 2040. The circuit is the same as the RP2040 except it only has the parts needed to run the 2040 and connect via USB. Perhaps there is a library that handles I2C that will run on the 2040. I would need help identifying where I would apply the library.

If you don't have the code then there is NO solution possible.

I think you are misunderstanding. I need help finding the existing code that does these functions and suggestions for modifying it to work without the WiFi chip.

I am misunderstanding. The code would have been written by someone, we are unlikely to find it laying about. Since it is a product, one of your co-workers must have written the code.
I can't imagine what else you might mean.

The code presumably was written by the Arduino team. I work alone.

the pins are the defined in board variant files in the boards platform folder

Thanks! I found the files. Now I need to know how to make the changes. It looks like Wire.h is the file that includes all of the arduino core including the aforementioned variant files. Is this true? (It is the only "factory" #include in my .ino file.)
Anyway, will I need to create another variant? If so, what is the best way to include that instead of the supplied code?

example

Thanks! Please let me know how I can include this in my project. I'm pretty much a newbie.

did you read the README there?

or maybe this can help too:

Thanks Juraj! I was able to put a package together. I think I'm close, but I am getting undefined reference errors to code that's in my variant folder. I followed the steps you outlined in the stackexchange posting. I based it on the arduino:mbed_nano:NANO_RP2040_CONNECT variant. To start I just copied the variant folder to my variant. Anyway, can you suggest a way to solve the undefined reference errors? Can you suggest some things to check? Thanks again!

what errors?

C:\Users\shann\AppData\Local\Temp\arduino\sketches\2EC52CBD005CA05A354033DF6B49FDB4\sketch\thors_arsenal.ino.cpp.o: In function `code_red(bool)':
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/lolevel_fxns.h:6: undefined reference to `analogWrite(NinaPin, int)'
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/lolevel_fxns.h:7: undefined reference to `analogWrite(NinaPin, int)'
C:\Users\shann\AppData\Local\Temp\arduino\sketches\2EC52CBD005CA05A354033DF6B49FDB4\sketch\thors_arsenal.ino.cpp.o: In function `crunch_key()':
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/Keyboard_fxns.h:52: undefined reference to `digitalRead(NinaPin)'
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/Keyboard_fxns.h:53: undefined reference to `digitalRead(NinaPin)'
C:\Users\shann\AppData\Local\Temp\arduino\sketches\2EC52CBD005CA05A354033DF6B49FDB4\sketch\thors_arsenal.ino.cpp.o: In function `keyboard_begin()':
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/Keyboard_fxns.h:737: undefined reference to `pinMode(NinaPin, PinMode)'
C:\Users\shann\Dropbox\moog\Thors Arsenal\code\thors_arsenal/Keyboard_fxns.h:738: undefined reference to `pinMode(NinaPin, PinMode)'

you have nina_pins.h in your variant?

Yes. At first I'm just trying to replicate the existing Arduino since I have hardware I can test. Then I'll try to adapt it to my new board once I have the structure that compiles without errors.

Wire.h is the I2C library.

to resolve the errors add #include <WiFiNINA.h> in the sketch.
until you redefine the pins handled by the nina firmware, they will require WiFiNINA

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.