Search found 13 matches

by rocotocloc
Wed Nov 13, 2024 6:44 am
Forum: ESP-IDF
Topic: ADC legacy vs OneShot
Replies: 1
Views: 448

Re: ADC legacy vs OneShot

I reply to myself. It's related to the attenuation, for some reason the default value is not the same in the legacy and new library. I have set 12 db attenuation and I am getting exactly the same value with both libraries: void water_probe_temperature_test_legacy(void *pvParameters) { int adc_raw; E...
by rocotocloc
Tue Nov 12, 2024 3:04 pm
Forum: ESP-IDF
Topic: ADC legacy vs OneShot
Replies: 1
Views: 448

ADC legacy vs OneShot

Hello, I have the following code that works perfectly fine to read the raw value from a temperature sensor (LM35DZ): #include "driver/adc.h" void water_probe_temperature_test_legacy(void *pvParameters) { int adc_raw; ESP_ERROR_CHECK(adc1_config_width(ADC_WIDTH_BIT_9)); while (1) { adc_raw = adc1_get...
by rocotocloc
Mon Nov 11, 2024 3:57 pm
Forum: 乐鑫活动专区
Topic: VsCode Debug fail
Replies: 2
Views: 4152

Re: VsCode Debug fail

aliarifat794 wrote:
Sun Aug 18, 2024 9:33 am
Check the power supply of the target device and also try to reset that.
This was my problem. Thank you.
by rocotocloc
Sat Oct 19, 2024 8:28 pm
Forum: ESP-IDF
Topic: How to update a value in a partition?
Replies: 10
Views: 2226

Re: How to update a value in a partition?

Ok thanks, I have the numbers now so I will choose the proper option according to final requirements.
by rocotocloc
Sat Oct 19, 2024 3:50 pm
Forum: ESP-IDF
Topic: How to update a value in a partition?
Replies: 10
Views: 2226

Re: How to update a value in a partition?

I got confused there, of course it’s 1024 variables, thanks. How often do I need to update the variables? Well, as long as I could be able to store them in flash if electricity goes off, I could handle them in RAM, but none of them shold be lost, they are indeed important statistical data the user n...
by rocotocloc
Sat Oct 19, 2024 11:17 am
Forum: ESP-IDF
Topic: How to update a value in a partition?
Replies: 10
Views: 2226

Re: How to update a value in a partition?

@nopnop2002, I could do what you suggest with W25 chips but in the ESP32 too, right? I mean they seem to have similar write/erase cycle limits. @ESP_Sprite, this is very clever indeed and very useful for this simple case where there are only 366 values but this sacrifices huge amount of memory space...
by rocotocloc
Sat Oct 19, 2024 10:18 am
Forum: ESP-IDF
Topic: How to check if partition has already been erased?
Replies: 4
Views: 858

Re: How to check if partition has already been erased?

It's clear now, I was thinking about that magic value too as an alternative.

Thank you for the help.
by rocotocloc
Fri Oct 18, 2024 5:12 pm
Forum: ESP-IDF
Topic: How to update a value in a partition?
Replies: 10
Views: 2226

How to update a value in a partition?

Hello, I am migrating one project from PIC to ESP32 and I have the following question regarding data storage. At the moment I use an external memory in the PIC to store some statistical data. The memory is divided in 366 chunks, one per day of the year, where I save what the equipment consumes every...
by rocotocloc
Fri Oct 18, 2024 10:50 am
Forum: ESP-IDF
Topic: How to check if partition has already been erased?
Replies: 4
Views: 858

Re: How to check if partition has already been erased?

Ok so let's say I reserve the first 4 bytes of the partition just to check whether it's erased or not. If I understand you correctly, can I assume that if I read those 4 bytes and they're not all 1, then the partition is not erased? Would it be correct something like this? Can I guarantee that if ch...
by rocotocloc
Fri Oct 18, 2024 7:05 am
Forum: ESP-IDF
Topic: How to check if partition has already been erased?
Replies: 4
Views: 858

How to check if partition has already been erased?

Hello, I am following this example to implement my own partition and store some statistical data in my project: https://github.com/espressif/esp-idf/blob/a97a7b0962da148669bb333ff1f30bf272946ade/examples/storage/partition_api/partition_ops/main/main.c It's simple enough and it works just fine but I ...