Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Clemens Kirchgatterer
@everslick
BTW, realloc CAN return NULL for the same reason malloc() returns NULL.
Develo
@devyte
never use realloc or free from an isr. That includes adding or resetting of managed objects with contiguous memory like String or std::vector
Viktr
@BbIKTOP
I do understand malloc is not realtime. but apart of that, what else can be a problem?
I meant that realloc can get NULL as a parameter ))
I use it at the startup, so it shall not influence the realtimity of the main loop though ))
Alexandr Zarubkin
@me21
Apart from that, you allocate memory at runtime, and it can fail at runtime, and you'll have to handle this. Whereas compile-time allocations fail at compile-time.
On another hand, your program may require less memory with malloc if two variables never exist together. You won't have to allocate memory to them at the same time.
It can be done with compile-time allocations, I think, it's just trickier
Hasenradball
@hasenradball
Hello wanna ask about settimeofday()
if i set the time once via ntp request. The time is synchroniced every hour. But where does the chip know the timeserver?
Develo
@devyte
the non-realtime nature of our malloc is not the same as usual implementations such as in a real OS. The only source of unbounded delays are interrupts. Assuming no interrupts, or even non-hostile interrupts, then our malloc does have an upper bound to its execution time
about runtime usage, yes it can cause fragmentation. However, the amount of fragmentation tends to reach a max for a particular app, i. e. it doesn't increase forever. There are always exceptions, though, there are some really oddball apps out there.
in contrast, use if stack never makes for fragmentation, but the stack sizes are super limited, currently at 4KB for CONT.
Develo
@devyte
malloc at global space can usually be avoided by static allocation. It's drawback is that it either doesn't allow for runtime changes, or if it does it requires realloc, which must be used with care.
So which mem handling you use depends on the particular needs of the piece if code you're writing
Develo
@devyte
@tablatronix what fatal compile?
david gauchard
@d-a-v
@hasenradball NTP server is set by DHCP (when your dhcp server knows it). Or by sketch by configTime().
Shawn A
@tablatronix
I don't think you can change the function of tout without rebooting, and even then for vdd33 the pin has to float
I suppose an empty analogReference could be added to avoid the compile issue
Chris Dalby
@moose4621
Can anyone tell me what this means?
ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v0c897c37
~ld
tobozo
@tobozo
bad power source ?
kiralikbeyin
@kiralikbeyin
i need eboot.bin
when i try make :
````
/bin/sh: 1: ../../tools/esptool/esptool: not found
`````found this but i couldnt make it .. https://forum.arduino.cc/index.php?topic=615178.0
Develo
@devyte
eboot is built with the app, the source code is in the repo
kiralikbeyin
@kiralikbeyin
@devyte did you compile source code because you will get this error : /bin/sh: 1: ../../tools/esptool/esptool: not found
Develo
@devyte
how are you building? If esptool were not fou d for sketch builds, all CI would be broken
kiralikbeyin
@kiralikbeyin
kiralikbeyin
@kiralikbeyin
esptool file needed --> https://github.com/igrr/esptool-ck/releases now i got eboot.bin
esptool.py and esptool files are different
Develo
@devyte
we dropped use of esptool-ck a few releases ago
Chris Dalby
@moose4621
@tobozo that's it. Thank you.
Sombuddha Chakravarty
@sammy1997

Hey. I am trying to read flash memory of NodeMCU that I have programmed from Arduino IDE. I am using pgm_read_byte from pgmspace library. However, it gives the following error:

Exception (28):
epc1=0x40201832 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont
sp: 3ffef760 end: 3ffef930 offset: 01a0

Can anyone help? I need to read firmware bits based on the input from serial port
Hasenradball
@hasenradball
Hi i have used an esp8266-01 about 1,5 Years as clock. Is it possible that the flash is damaged due to th write cycles of setting the time?
Clemens Kirchgatterer
@everslick
@hasenradball why would setting the time write to the flash?
@sammy1997 too little information
tobozo
@tobozo
@hasenradball how often do you write and how big is the data ?
Hasenradball
@hasenradball
@everslick Hi I thought the this is held in Flash but Iam not sure...
I used config time to setup the date and time, so every Hour I think it has synchronized.
Or do anyone have an other Idea?
Is there an possibility to check the memory?
Hasenradball
@hasenradball
@tobozo i flashed below 50 times about 300 k bytes
How can I disable the wifi on the ESP8266-01 ?
Sombuddha Chakravarty
@sammy1997
@everslick I want to execute a remote attestation protocol. To do that my RasPi needs to read some bytes over the serial port from the flash memory of devices like Arduino, NodeMCU, etc. For Arduino, I had used the <avr/pgmspace.h> library to do this. I want to do the same with NodeMCU. So the RasPi will send a number serially which will denote the starting bit to be read, and then the nodeMCU should read 1 byte from its flash and return it.
However, when I am using the pgmspace library with NodeMCU to do the same, I am getting the error I mentioned
Clemens Kirchgatterer
@everslick
pgm_read_byte() is for reading data that you compiled into the binary using PROGMEM. for example: static const char PROGMEM day_name[] = { "Sun\0Mon\0Thu\0Wed\0Thu\0Fri\0Sat\0" }; and then later: pgm_read_byte(&day_name[4]);
that works on ESP8266
Sombuddha Chakravarty
@sammy1997
@everslick What if I want to read the bits of the compiled code after it has been uploaded as a sketch to the flash instead of variables that I declared using PROGMEM?
Clemens Kirchgatterer
@everslick
tobozo
@tobozo
@hasenradball if that's 50 times a day, it's not enough to kill your flash
Sombuddha Chakravarty
@sammy1997
@everslick Thanks! I will give it a try
Develo
@devyte
flash typical write cycles is of the order of 100.000 before burnout, except for Puya chips where it's of the order of 10.000. I don't remember where I got those numbers.
Hasenradball
@hasenradball
Than this is not the reason...