Getting “Error: Fatal error: C3903U: Argument ‘Cortex-M4.fp.sp’ not permitted for option ‘cpu’.” on online compiler on old dht22 programm

Hi, I was trying some old program related to dht22 and I am getting a similar error.
“Error: Fatal error: C3903U: Argument ‘Cortex-M4.fp.sp’ not permitted for option ‘cpu’.”
please help

Ahoj,

The name of topic is not optimal, that tell nothing to anyone. Also the section - the problem not seems be a bug of online compiler.

When you want help with something it is good to provide full informations like:

  • link to a code what you tried
  • information about state, that mean - did you use it in original state or you already updated the mbed library and so on?
  • what a board you use

Let’s say you tried this one. It uses old MbedOS2 and also its old revision (from 2014) where your board wasn’t probably supported and that is reason of this error. For example - it is compilable with LPC1768 but not with Nucleo-F446RE.
So hit the Mbed library in your project by right click and choose Update.

If you will want to use it in any latest version of MbedOS library, it will be necessary more steps. The library looks simple and it is based only on DigitalOut API, but c++ version/syntax seems to be incompatible and also wait_ms() is obsolete.

BR, Jan

Hi JohnnyK,
Sorry for the incomplete quarry. However, I was too frustrated because of this error. Documentations were not so helpful for me in this case, so here I am putting a complete update.
I was using some old DHT programs just for testing purposes. I tried many libraries some of them are,
AM2303_Hello_World - An example to use an AM2303 (a.k.a. DHT22) humidi… | Mbed SimpleDHT22_output - A simple working example showing the usage of Ste… | Mbed DHT22tester - Tester for DHT22 | Mbed
and I can’t remember but I also get similar issue with the official dht22 example program.
However, with further tried and I removed the mbed library by just deleting the mbed dir from program dir and reimport it and now complication is successful. Also, I tested one of these libraries and it worked. I will update later after testing other libraries if they are working or not.

Hi,
Sorry for incomplete information. I was just trying to make one test program work as I am just a newbie here. So, here is the complete update.
I was just trying some random libraries and here are two observations.
a. all libraries are without a proper example b. they are all very old

after that, I chose some simple programs and make some changes according to my board and try to compile it. I got the error I mentioned before. some of these libraries are,

even the official program also gave the same error.
https://os.mbed.com/components/RHT03/
and some more.

However, when I removed the mbed library present in the programmed library by just deleting it and again import it from the import option. one of the libraries compiled successfully. maybe someone can explain it better. I will try with other libraries and update it.

One thing I would like to say at least they should keep official examples up to date so beginners can get some understanding of the platform and work with confidence.

1 Like