Search found 3467 matches

by dhylands
Sat Jul 18, 2020 10:14 pm
Forum: General Discussion and Questions
Topic: Strange behaviour class variables [SOLVED]
Replies: 9
Views: 694

Re: Strange behaviour class variables [SOLVED]

If you want to increment the class variable then you can use a class reference.

i.e. use Foo.x += 1 rather than self.x += 1
by dhylands
Fri Jul 17, 2020 10:21 pm
Forum: MicroPython pyboard
Topic: /sd gone round 2
Replies: 3
Views: 372

Re: /sd gone round 2

How big is the SD card?

Make sure that the SD card if formatted as FAT.

I just tried a 32Gb card and it worked fine.

Make sure you power on the pyboard AFTER inserting the sdcard.
by dhylands
Fri Jul 17, 2020 3:08 pm
Forum: MicroPython pyboard
Topic: [SOLVED] can't connect to REPL
Replies: 14
Views: 905

Re: can't connect to REPL

Note that you need to logoff and log back in again (or reboot) after changing groups.

You can use the id command to confirm your group membership.
by dhylands
Fri Jul 17, 2020 2:56 pm
Forum: General Discussion and Questions
Topic: Using sockets but keep getting syntax error.
Replies: 4
Views: 350

Re: Using sockets but keep getting syntax error.

You need to surround the argument to http_get in quotes.
by dhylands
Tue Jul 14, 2020 4:46 pm
Forum: General Discussion and Questions
Topic: How long have you had to spend on taking up skateboarding?
Replies: 0
Views: 219

Re: Is it possible to run micropython scripts loaded from hTTP?

It should definitely be possible to do. Basically, it mostly boils down to how much memory you have. But you can use exec to execute a string containing python source code.

Code: Select all

>>> exec('for i in range(5):\n  print("i =", i)\n')
i = 0
i = 1
i = 2
i = 3
i = 4
>>> 
by dhylands
Tue Jul 14, 2020 4:42 pm
Forum: Development of MicroPython
Topic: Memory allocation and deallocation
Replies: 21
Views: 5281

Re: Memory allocation and deallocation

...For the bare-metal ports, malloc doesn't appear to exist at all. m_malloc gets mapped to gc_alloc inside the py/malloc.c file... Does that mean that, on bare-metal ports, C allocates memory from the Python heap? The python heap is the only heap available on the bare metal ports. The code would n...
by dhylands
Mon Jul 13, 2020 10:38 pm
Forum: Development of MicroPython
Topic: Memory allocation and deallocation
Replies: 21
Views: 5281

Re: Memory allocation and deallocation

Right - if you allocate something in C land (using malloc or whatever) then a pointer to that object either needs to be stored inside a python object or needs to be stored someplace in the root pointers area or the garbage collector will consider the alloced memory to be "unused" and will free it t...
by dhylands
Mon Jul 13, 2020 5:59 pm
Forum: Development of MicroPython
Topic: Memory allocation and deallocation
Replies: 21
Views: 5281

Re: Memory allocation and deallocation

Right - if you allocate something in C land (using malloc or whatever) then a pointer to that object either needs to be stored inside a python object or needs to be stored someplace in the root pointers area or the garbage collector will consider the alloced memory to be "unused" and will free it th...
by dhylands
Mon Jul 13, 2020 5:53 pm
Forum: Other Boards
Topic: WeActSTM32F411CEU6 filesystem corruption
Replies: 4
Views: 495

Re: WeActSTM32F411CEU6 filesystem corruption

Also keep in mind that the STM32F411CEU6 only has 512K of flash. The default firmware and filesystem take up 376K Due to the way the flash is laid out, this means that the only available flash block is a 128K one that starts at the 384K mark. Due to RAM memory constraints you can only use 64K of any...
by dhylands
Sun Jul 12, 2020 4:30 pm
Forum: General Discussion and Questions
Topic: Disabling REPL on ESP32
Replies: 1
Views: 272

Re: Disabling REPL on ESP32

Disabling the REPL won't really help you.

You can still run esptool.py and download the entire flash and then just grab stuff from the filesystem using code running on the host.