Usage of Linker libraries "nosys" and flags "-specs=rdimon.specs"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Usage of Linker libraries "nosys" and flags "-specs=rdimon.specs"

Jump to solution
1,988 Views
itr1718
Contributor III

Hello,

 

I am using mcu MKL27Z256 and kinetis design studio. 

While I debug my code, I have questions.

 

First of all, I am using a function "gettimeofday" to get timestamp. ("clock_gettime" don't work even if header files are defined.) I defined "nosys" in Linker libraries following USB CDC example from SDK. If "nosys" is defined, the function "gettimeofday" returns error -1 such as "Function not implemented". 

Which relationship do they, "gettimeofday" and "nosys", have? 

How can it be solved or should I use other functions?

 

Second, I am using a delay function "usleep". As I understand, I need "-specs=rdimon.specs" in linker flags for file system and semihosting and "usleep" can be declared with this flag. But USB virtual com port will be recognised only like below when I debug the code. PC don't recognise usb com port, if the board is connected just via USB (no debugging, IDE).

itr1718_0-1612360589489.png

 

What does the flag "-specs=rdimon.specs" affect the USB driver?

Which relationship do they have?

0 Kudos
1 Solution
1,946 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @itr1718,

That's right, you could use the RTC if you want to keep in the MCU the date and the PIT/Systick/TPM if you want to implement a delay.

You could check, the tpm_timer, the pit or if you want to use the systick check the led_blinky example.

Best Regards,

Alexis Andalon

View solution in original post

0 Kudos
3 Replies
1,974 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @itr1718,

MCUXpresso includes three libraries that manage the standard C libs:

  • Newlib
  • NewlibNano
  • Redlib

These include basic C libraries as time, stdio y stdlib. If you include the nosys flag, any of these libraries will be included.

Also, about the usleep function, are you using FreeRTOS?

Best Regards,

Alexis Andalon

0 Kudos
1,961 Views
itr1718
Contributor III

Hello @Alexis_A ,

thanks for your reply.

I am using bare metal. 

 

If I want to use gettimeofday or get execution timestamp without them, libraries, is it available with Real time clock or Periodic interrupt timer?

I tried with system tick, but I had no idea. 

 

Best regards

itr

0 Kudos
1,947 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @itr1718,

That's right, you could use the RTC if you want to keep in the MCU the date and the PIT/Systick/TPM if you want to implement a delay.

You could check, the tpm_timer, the pit or if you want to use the systick check the led_blinky example.

Best Regards,

Alexis Andalon

0 Kudos