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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
4,446件の閲覧回数
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 件の賞賛
返信
1 解決策
4,404件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
4,432件の閲覧回数
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 件の賞賛
返信
4,419件の閲覧回数
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 件の賞賛
返信
4,405件の閲覧回数
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 件の賞賛
返信