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).
What does the flag "-specs=rdimon.specs" affect the USB driver?
Which relationship do they have?
Solved! Go to Solution.
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
Hello @itr1718,
MCUXpresso includes three libraries that manage the standard C libs:
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
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
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