Search found 12 matches

by Drako
Fri Jun 15, 2018 6:39 am
Forum: General Discussion and Questions
Topic: How to free memory after unused imports?
Replies: 8
Views: 588

Re: How to free memory after unused imports?

I have had the same experience as Peter. I cleared the sys.modules and delteted everything from the globals and still couldn't free up the whole memory. from gc import collect # @UnresolvedImport from sys import modules, path path.clear() path.insert(0, '') path.insert(0, '/sd') modules.clear() coll...
by Drako
Fri Jun 01, 2018 6:39 am
Forum: General Discussion and Questions
Topic: Freezing Dictonary in Flash
Replies: 5
Views: 490

Re: Freezing Dictonary in Flash

I see. At the moment I don't have that much data, so implementing it as a C module is problaby not worth the effort. I am basically attaching strings to error codes, so freezing the strings in the firmware and then building the dictonary in the source code works for now. If I am reaching the limits ...
by Drako
Thu May 31, 2018 8:26 am
Forum: General Discussion and Questions
Topic: Freezing Dictonary in Flash
Replies: 5
Views: 490

Re: Freezing Dictonary in Flash

This makes perfect sense. Thanks
by Drako
Thu May 31, 2018 7:48 am
Forum: General Discussion and Questions
Topic: Freezing Dictonary in Flash
Replies: 5
Views: 490

Freezing Dictonary in Flash

Hi, I understand that freezing strings in the flash saves RAM in micropython. A source file containing MY_STRING = 'this is a long string, but I want it to be only a machine word in the RAM of the actual devcie' which is frozen into the falsh and then imported saves RAM. Is is also possible to freez...
by Drako
Tue Apr 03, 2018 6:27 am
Forum: General Discussion and Questions
Topic: STM32F429 Flash Memory Size
Replies: 2
Views: 323

Re: STM32F429 Flash Memory Size

The filesystem is created by micropython on startup. The file flashbdev.c is defines at which adress and how many blocks are used for the file system. (Previously it was located in the storage.c) #elif defined(STM32F429xx) #define CACHE_MEM_START_ADDR (0x10000000) // CCM data RAM, 64k #define FLASH_...
by Drako
Fri Mar 09, 2018 8:05 am
Forum: General Discussion and Questions
Topic: Btree Module on stm32
Replies: 3
Views: 496

Re: Btree Module on stm32

Hi, good advice, but I didn't get to compile the firmware for an stm32 port with the BTREE module enabled. When I add the define for BTREE in the mpconfigboard.h, I get the following error: build-mcCPU_F7V01/py/objmodule.o:(.rodata.mp_builtin_module_table+0xc4): undefined reference to `mp_module_btr...
by Drako
Thu Mar 08, 2018 11:09 am
Forum: General Discussion and Questions
Topic: Btree Module on stm32
Replies: 3
Views: 496

Btree Module on stm32

Hi, I tried to implement the Btree module in a custom board with an stm32F765. When in implement the line "#define MICROPY_PY_BTREE (1)" into the mpconfigboard.h, I get an error when creating the firmware: "In file included from ../../py/objmodule.h:29:0, from ../../py/objmodule.c:30: ../../py/objmo...
by Drako
Fri Nov 10, 2017 7:04 am
Forum: General Discussion and Questions
Topic: micropython.schedule inside class
Replies: 6
Views: 1428

Re: micropython.schedule inside class

Yes, Dave you are right again ! class CanInterface(CAN): # ------------------------------------------------------------------ def __init__(self, itf): self.can = CAN(itf) self.init_can_bus() self.bound_method = self.test_func # create method in constructor # -----------------------------------------...
by Drako
Thu Nov 09, 2017 5:51 pm
Forum: General Discussion and Questions
Topic: socket problem
Replies: 4
Views: 1167

Re: socket problem

I am guessing here but maybe try a socket.close() on the socket instance when you are done?
In your case s.close()
Or try garbage collecting manually by using gc.collect(), or both...
by Drako
Thu Nov 09, 2017 12:35 pm
Forum: General Discussion and Questions
Topic: micropython.schedule inside class
Replies: 6
Views: 1428

micropython.schedule inside class

Hi everyone, catching an CAN bus interrupt in a class and calling a scheduled function leads to a MemoryError. I create a class which inherits from pyb.CAN. I initialize Can, and attach a callback function to it. In the callback function I schedule antoher function uising micropython.schedule(). Whe...