-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Low memory available, stability problems may occur #19
Comments
For me, that warning went away with commit ae4205c.. on Apr 6.
But it looks like the Apr 8 reformatting/cleanup commit reverted the changes of the three previous commits. Additionally, the F() macro is getting clobbered by redefining F for use as a PID parameter: |
Are you working with the team? Making one of these solo with their code? Something else?
That's important. That's too bad. Using git is a fairly complicated skill so it's easy to mess up. Can you give me a link to a branch that was prior to the merge and point out which commits were lost? I can look at them and see what was changed and put the changes back in if necessary.
Good to know. We need to fix this. I'm about to start cleaning up the code but my first 2 PRs already touch like 230 files or something, so until they merge I'm afraid to change too much more. I'll end up touching nearly every line by the time I'm done and I don't want to mess up work underneath them. |
@jsodergren, If you're working on the code right now, watch out for my changes! If so, you should pull my #20 branch right now and rebase on top of it. Let me know if you're working on stuff so I can be aware. |
Good to know of your work and PRs. I haven't submitted any PRs (yet); just trying to modify the released code slightly to work with our build (I'm part of a small team in Alaska working to replicate the device). Aside from the already-mentioned macro issue, I'm using a different LCD panel (NHD-0420D3Z 20x4) and have written a minimal library to use it with this code. From what I can tell, the Apr 8 commit (a480902) reversed the changes made in commits 352b36a, e8fb1d9, and ae4205c. Here's the point right before those changes were reversed; this is what I'm currently working with: https://github.com/AmboVent/AmboVent/tree/352b36a447adc2dabcf7890711da37fb903b46d6 |
just released a new ver. that returned the lost functionality (accepted a PR that suggested readability improvements without noticing it was based on old ver.)
|
I have just today submitted a new pcb . I plan on porting the code to esp32 all the Libs used seem to be supported. A simple next gen pcb will be esp32 no memory shortage and not running 24bit math on a 8 bit ATmel. This is my solution a hardware upgrade for me to replace the nano with a esp and Jtag can start if needed. I can have that version done by the end but I only have one ESp32-wroom that I can debug with . Sorry if it is a 10 pound hammer solution. |
@Arie001, the real problem was coding. Simply using progmem and the F() macro could decrease RAM usage from 90% to 30%, for instance. I see they added just a couple usages of progmem and it's already down from 91% or so to like 55% RAM used by global variables. |
Note: please don't close this issue until at least all strings have been surrounded by the F() macro and all large const arrays or structs (if any) have been moved to progmem. |
Porting the code to esp32 you might experience issues with ADCs on esp32. The ADC values are non-linear. You get the same ADC resolution for high and low voltages. Then also the error between actual measurement and value measure by ADC is about 10% |
I do not know where you get your esp32 or but a esp can read a2d Just Fine no where near 400 counts error If all it has to do is measure a a2d of a pot . Advise a rc filter cap on the a2d pin so are you saying .And No at 0db is not the same as -3db put into the same a2d We are talking about memory 92% vs 5% Platform IO i2C 4 Leds 3 switches 3 Pots and a analog feedback is not pushing the limit . It is alive on the uart at 115200 |
Wow.. Makes a lot of sense... Seems like you're done porting it to esp32 About the ESP ADC issue espressif/esp-idf#164 here you go |
would you mind sharing the code and pcb design |
off topic The ESP32 has a native range of 1.1v Full so 1.1/4096 is scale if you measure on 3.3v full scale it is 3.3 /4096 -6db . To say the error is the same no matter if I use 1.1v or 3.3v shows a lack of Knowledge.Do you claim I put 500mv dc onto a a A2D I get either 450mv or 650mv no matter if I am on a 1.1v range ore 3.3V.The Error is the same no matter The Range.The a2d in not 100 Linear On topic my code is the same code as the this project imported to platform io I changed the the servo library to https://www.arduinolibraries.info/libraries/esp32-servo it did not compile it had issues with the variable called index char * to int conversion fail . I renamed Index Index_arie it compiled .download. I only have esp32 bare modules not a devkit . For Idea of how I will be doing the circuit please see https://arie-lashansky.info/corona/carona_HX711.pdf My Style is to be very careful Esp top right 2esp pots page 1 bottom left dual pots below esp ( Backup Motor feed Back too) Who knows I may even look at a second full mechanical backup.second Ambo bag As my Input is not wanted or needed here. I all allowing myself to diverge from the design done by the 40 experts engineering and medical experts . From my circuit my style is clear no way in hell will I put a pull up to 4.7k pull up to 5v on a device that the datasheet says max IO voltage in VDD . I put two sensors in the box and box not 1 . https://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Data+Sheet%7FMS5803-01BA%7FB3%7Fpdf%7FEnglish%7FENG_DS_MS5803-01BA_B3.pdf%7FCAT-BLPS0038 ( page 5 max allowable voltage on pins SCL and SDA) Note Jumpers allow cheap and 100% backup ( They are be wire links) It is a Question of how you view your design . I am not a mechanical engineer and my software skills are limited . Just a unemployed Electronics person that has over 30 years no second degree in Engineering not Who I am is clear where I come from is clear I have even added my resume the one that Who I am is clear as daylight did I know a closed pcb was in the works for this design yes. Did I need need to generate my own DXF Yes never done before my me in a design where I was Mix This the two pcbs below remove the (nxp pressure sensors and Arduino). I will be a 4 layer board.3v 3vaux 5v and 5v_aux 12v 12aux on split planes. https://grabcad.com/library/ambervent_pcb-baisic-placement-1 |
Hey we didn't say that. I'm just a random guy who started poking at this project a few days ago--not part of the team. All I know is, before I go changing something I have no control over (the entire microcontroller, for instance), I'd like to get the code cleaned up. My goal: clean the code. Make it robust. If I do that. I will be happy. Based on what I see, the Nano is more than adequate. I've been using it for thousands of hours and it's tough to actually hit its limits--they definitely aren't, from what I see skimming the code. So...back to cleaning the code and making it better. They did a great job, I just want to contribute what I can.
I don't know what you're saying here either.
For this project, their license seems to indicate this is true, as it releases it to public domain. For most open source projects (let's say...I don't know--99% of them), this is absolutely false. Someone owns the IP--they just provide open source licenses to anyone is all. I own all the IP on my open source projects, pure and simple. They are licensed--by me--with open source licenses. We have diverged massively from the point of this thread to fix some memory issues. And I hope you can find good work. Remember to use LinkedIn, network with everyone, and practice interviewing skills. Be willing to move anywhere required--wherever the jobs are. Also have a solid resume and showcase your skills with past and present projects--personal or otherwise. |
Had the same issue while porting to esp32 yesterday, the servo, and LCD libraries are incompatible.. Still had the issue with |
Please open a new issue and link to it here. I need some clarity. What variable where needs to be renamed to what, due to what error? Here's line 138: https://github.com/AmboVent-1690-108/AmboVent/blob/master/3-Software/Arduino/ventilation_machine/ventilation_machine.ino#L138
|
I renamed the Index Issue as part of my Debug in getting it to compile I do it often to find where I have made changes. It is a way of me finding my Changes it is part of my workflow. I do not leave it that way.To search and replace Index_arie with Main_index is simple . It is part of debugging. Index is in 24 places in the code that is about 750 lines I use that method for Debug why do you think I am not uploading the code . I do not even Know on what Lib Index was defined Char* The Time was spent to see the memory Footprint no more no Less . I am not a Embedded Software I am working in a environment called Platform IO on Visual Studio code on a Part ESP32 not related I needed to Change Sevo. to the ESP version the simple solution was the one I took it. The Part from the Sevo32 Lib is not the problem but shows how hard it is to Find |
This issue can be closed current version only uses 1k so 1k Free https://github.com/AmboVent-1690-108/AmboVent/tree/master/3-Software/Arduino/ventilation_machine |
When I build the project for the Arduino Nano I see the following output in the Arduino IDE:
This is a problem, as it means the stack is nearly completely used up by global variables, so local variables in any scope or code section could potentially overflow the stack really easily. I think I can do some code cleanup to fix this, perhaps by moving strings to progmem with the
F()
macro, or using other coding techniques. I'll have a look at the code.Read more on the
F()
macro here:UPDATE 20 APR 2020:
The bulk of this issue is resolved now that the two big lookup tables in the code are in progmem, but let's still not close this issue until at least all strings have been surrounded by the F() macro and all large const arrays or structs (if any) have been moved to progmem.
F()
macroThe text was updated successfully, but these errors were encountered: