Troubleshooting

This page describes some errors and fixes that have already been encountered in this project. An attempt has been made to loosely organize this page, although Copy + F is recommended for finding specific error messages.

Simplicity Studio Compiler Errors

Invalid conversion from (…)

invalid conversion from 'long unsigned int' to '______' [-fpermissive]

Errors of the type "invalid conversion from 'type1' to 'basicallyType1ButTechnicallySlightlyDifferent' can be solved by explicitly casting that variable to that specific type.
// Ex:
//turn:
unsigned char message[] = {reg_address + command};
// into:
unsigned char message[] = {(unsigned char)reg_address + (unsigned char)command};

Default argument given for parameter (…)

default argument given for parameter 1 ... [-fpermissive]

Typically in C++, default values can be declared in the header file of a function (or wherever the function is declared, if not in the header file). It doesn't look like Simplicity Studio allows this in the header file, even though it uses the G++ compiler. It will allow them in declarations outside of the header file, for example an internal function with a declaration at the top.
Solution: Do not include default value for now in the header file.

Getting printf() to print to console

Please see this tutorial that I wrote explicitly to solve this problem.

Tip: You must have a '\n' at the end of your print line or else it won't immediately print to console.


Printing floats with printf()

Please see the bottom of this tutorial to solve this problem.


Interrupt conflicting with delay

"USTIMER_Delay(us)" is not appropriate when using threads or interrupts, because it also uses interrupts. Simply switch this to "USTIMER_DelayIntSafe(us)" [1].


DP write failed - Could not access Debug challenge interface

You have probably bricked your device - time to attempt recovery.


Note about peripherals and clock sources

Good tip:

WARNING: If you try to use a peripheral whose clock source is not configured, nothing will happen. Nothing BAD will happen, it just won’t do what you expect and the compiler will not complain at all. You will sit there stumped for a while. Personally, I forget to enable clock sources for the peripherals that I use all the time. After a while, it becomes the automatic first thing that I check when things don’t work as expected.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License