Re: How can I measure elapsed time?

2021-04-29 Thread Brennan Ashton
On Thu, Apr 29, 2021, 10:46 PM yuta wrote: > > I changed "System timer tick period (microseconds)" from 1 to 1000 > then I got 1.001000 sec in result which is more exact than before. > I'll try Tickless OS configuration if I need later. > Increasing the tick rate may increase the resolution

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Frank-Christian Kruegel
Am 29.04.2021 um 20:43 schrieb Gregory Nutt: ... The main reason is that the AT24XX MTD driver only can handle one type of devices on a single bus. .. The is a deficiency in the driver and should be pretty easy to fix by passing the I2C address during driver initialization.  Other drivers do

Re: How can I measure elapsed time?

2021-04-29 Thread yuta
Bernd, Thank you for giving me an example. I tried it with 1sec( 100us) sleep, then I got 1010. I think 1010 represent elapsed time in milliseconds and this is the same accuracy as I tried before. After changing CONFIG_USEC_PER_TICK from 1(default) to 1000, I got 1001 which is bett

Re: How can I measure elapsed time?

2021-04-29 Thread yuta
Alan, Thank you for sharing the link. I checked it and I understand CONFIG_USEC_PER_TICK(default 1) is important when using some functions like usleep(). It won't work well if I try usleep(1) or shorter. Thank you. Yuta Ide On 2021/04/30 2:49, Alan Carvalho de Assis wrote: Hi Yut

Re: How can I measure elapsed time?

2021-04-29 Thread yuta
Brennan, Thank you for telling me the details about CPU time measurement. I did not know that CPU would not be used when during sleep on Linux. I googled it later and now my understanding is that when doing sleep CPU is not busy but idle state and that's why CPU time measurement would be clo

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Gregory Nutt
... The main reason is that the AT24XX MTD driver only can handle one type of devices on a single bus. .. The is a deficiency in the driver and should be pretty easy to fix by passing the I2C address during driver initialization.  Other drivers do that.

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread David S. Alessio
On Apr 29, 2021, at 10:12 AM, Frank-Christian Kruegel wrote: > > Am 29.04.2021 um 15:23 schrieb Gregory Nutt: >> There are several Microchip/Atmel boards that come with an Atmel MAC in >> AT24MAC402 EEPROM. You should be able to clone that logic (including >> setting the MAC address). See: >>

Re: How can I measure elapsed time?

2021-04-29 Thread Bernd Walter
I usually do the following to measure time differences: struct timespec tp; uint64_t starttime; clock_gettime(CLOCK_MONOTONIC, &tp); starttime = ((uint64_t)(tp.tv_sec) * 100) + tp.tv_nsec / 1000; //do something clock_gettime(CLOCK_MONOTONIC, &tp)

Re: How can I measure elapsed time?

2021-04-29 Thread Alan Carvalho de Assis
Hi Yuta, Please read this documentation with more info about it: https://cwiki.apache.org/confluence/display/NUTTX/Short+Time+Delays BR, Alan On 4/29/21, yuta wrote: > Brennan, > Thank you for your advice. > > I checked links you shared and > https://www.gnu.org/software/libc/manual/html_node

Re: How can I measure elapsed time?

2021-04-29 Thread Brennan Ashton
On Thu, Apr 29, 2021, 10:07 AM yuta wrote: > Brennan, > Thank you for your advice. > > I checked links you shared and > https://www.gnu.org/software/libc/manual/html_node/CPU-Time.html > I got elapsed time. Thank you. > > However I'm wondering why the elapsed time I got was not exactly the same >

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Frank-Christian Kruegel
Am 29.04.2021 um 15:23 schrieb Gregory Nutt: There are several Microchip/Atmel boards that come with an Atmel MAC in AT24MAC402 EEPROM.  You should be able to clone that logic (including setting the MAC address).  See: samv7/samv71-xult/src/sam_ethernet.c samv7/same70-xplained/src/sam_ethernet

Re: How can I measure elapsed time?

2021-04-29 Thread yuta
Brennan, Thank you for your advice. I checked links you shared and https://www.gnu.org/software/libc/manual/html_node/CPU-Time.html I got elapsed time. Thank you. However I'm wondering why the elapsed time I got was not exactly the same I expected to get. I tried below. // * start clock_t

Re: How can I measure elapsed time?

2021-04-29 Thread Brennan Ashton
On Thu, Apr 29, 2021, 8:16 AM yuta wrote: > Hi all. > > I'm new to NuttX. > > I'm not sure if it's no problem me asking some personal question about > NuttX here. (please tell me if better place to ask.) > > by the way, I have made my app in apps/examples/. It's working > well. Now, I would like

How can I measure elapsed time?

2021-04-29 Thread yuta
Hi all. I'm new to NuttX. I'm not sure if it's no problem me asking some personal question about NuttX here. (please tell me if better place to ask.) by the way, I have made my app in apps/examples/. It's working well.  Now, I would like to measure elapsed time during processing a program b

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Gregory Nutt
I assumed that the MAC is held in extended memory like the Atmel parts (otherwise, not much in the previous email makes sense). 183   /* Put the AT24 back in normal memory access mode */ 184 185   ret = at24->ioctl(at24, MTDIOC_EXTENDED, 0); 186   if (ret < 0) 187 {

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Gregory Nutt
There are several Microchip/Atmel boards that come with an Atmel MAC in AT24MAC402 EEPROM.  You should be able to clone that logic (including setting the MAC address).  See: samv7/samv71-xult/src/sam_ethernet.c samv7/same70-xplained/src/sam_ethernet.c These keep the MAC address in the AT24MAC4

Re: How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Alan Carvalho de Assis
Hi Frank-Christian, For small EEPROM you can use the EEPROM char driver directly, please take a look inside drivers/eeprom/ Then in your board side you just need to do something like this: finfo("Initialize I2C%d\n", AT24_I2C_BUS); i2c = sam_i2c_master_initialize(AT24_I2C_BUS); if (!

How to use small I2C EEPROMs the NuttX way?

2021-04-29 Thread Frank-Christian Kruegel
Hi. I'm currently porting NuttX to some proprietary compute modules with STM32F7 and STM32H7. Each and every board has got a small AT24MAC402 256 Byte EEPROM with additional UID and MAC address accessible under a second I2C address, and many boards have an additional AT24C256 32kB EEPROM. I'

Re: Replacing SmartFS to LittleFS

2021-04-29 Thread Flavio Castro Alves Filho
Hello Xiang, > > > Yes, if you just want to create an empty littlefs partition, littlefs > driver can do it without the userspace tool assistance. > Either run the mount command from nsh: > mount -t littlefs -o autoformat /dev/mtd /mnt > Or call mount function from board_initialize like this: > mo