Building new firmware for the PCC

Hi there, our team made some changes to the PCC firmware (to support an additional servofeatherwing), and we wanted to rebuild the pcc firmware and upload it.

Unfortunately, we have been running into issues, and have been unable to have the file result in an output file. Please advise on any potential solution

1 Like

Here is an update, this is the specific error we are having into now when we run

[‘pio’, ‘run’, ‘–verbose’]
Traceback (most recent call last):
File “”, line 198, in run_module_as_main
File “”, line 88, in run_code
File "C:\Users\Row Dyer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\pio.exe_main
.py", line 4, in
File "C:\Users\Row Dyer\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pio_init
.py", line 5, in
import requirements
ModuleNotFoundError: No module named ‘requirements’
Traceback (most recent call last):
File “C:\Users\Row Dyer\Documents\AVR-2023\AVR-2022\PCC\”, line 11, in
subprocess.check_call(cmd, cwd=THIS_DIR, shell=True, stderr=subprocess.STDOUT)
File “C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1776.0_x64__qbz5n2kfra8p0\Lib\”, line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘pio’, ‘run’, ‘–verbose’]’ returned non-zero exit status 1.

Okay, we are making some form of forward progress, when running pio run --verbose, we are getting this error message:

In file included from libraries\AVR_SerialParser\serial_lib.cpp:1:
libraries\AVR_SerialParser\serial_lib.hpp:45:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]   
   45 | static char *outgoing_preamble = "$P>"; //towards arduino  
      |                                  ^~~~~
libraries\AVR_SerialParser\serial_lib.hpp:46:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]   
   46 | static char *incoming_preamble = "$P<"; //towards jetson   
      |                                  ^~~~~
libraries\AVR_SerialParser\serial_lib.cpp: In constructor 'AVRSerialParser::AVRSerialParser(Adafruit_USBD_CDC, cppQueue)':
libraries\AVR_SerialParser\serial_lib.cpp:3:74: error: no matching function for call to 'cppQueue::cppQueue()'
    3 | AVRSerialParser::AVRSerialParser(Adafruit_USBD_CDC port, cppQueue queue_q)
In file included from libraries\AVR_SerialParser\serial_lib.hpp:2, 
                 from libraries\AVR_SerialParser\serial_lib.cpp:1: 
.pio\libdeps\adafruit_feather_m4\Queue\src/cppQueue.h:57:2: note: candidate: 'cppQueue::cppQueue(size_t, uint16_t, cppQueueType, bool, void*, size_t)'
   57 |  cppQueue(const size_t size_rec, const uint16_t nb_recs=20, const cppQueueType type=FIFO, const bool overwrite=false, void * const pQDat=NULL, const size_t lenQDat=0);
      |  ^~~~~~~~
.pio\libdeps\adafruit_feather_m4\Queue\src/cppQueue.h:57:2: note:   candidate expects 6 arguments, 0 provided
.pio\libdeps\adafruit_feather_m4\Queue\src/cppQueue.h:32:7: note: candidate: 'constexpr cppQueue::cppQueue(const cppQueue&)'
   32 | class cppQueue
      |       ^~~~~~~~
.pio\libdeps\adafruit_feather_m4\Queue\src/cppQueue.h:32:7: note:   candidate expects 1 argument, 0 provided
In file included from libraries\AVR_SerialParser\serial_lib.cpp:1: 
libraries\AVR_SerialParser\serial_lib.hpp: At global scope:        
libraries\AVR_SerialParser\serial_lib.hpp:45:14: warning: 'outgoing_preamble' defined but not used [-Wunused-variable]
   45 | static char *outgoing_preamble = "$P>"; //towards arduino  
      |              ^~~~~~~~~~~~~~~~~
*** [.pio\build\adafruit_feather_m4\libf27\AVR_SerialParser\serial_lib.cpp.o] Error 1

Okay, not 100% certain how I managed to come to the resolution, but for future notice:

  1. Do not modify any files until you can get it to build with the default files, as it will cause unnecessary amount of variables that it could be to check
  2. use the basic setup as outlined here, however stop at the install requirements.txt step, and instead…
  1. Read the readme file!! and use the setup and build commands!!
  2. Read the error messages, and if you are like me (no clue what you are doing) use something like ChatGPT to help you understand what it is saying
  3. I have found the command to give worse error messages than running pio run --verbose so if it is not building, perhaps try to run that

Hope this was helpful!

1 Like