Search found 10 matches

by Ephreal
Tue Dec 31, 2019 9:30 am
Forum: General Discussion and Questions
Topic: How to find the absolute memory pointer to a buffer.
Replies: 4
Views: 434

Re: How to find the absolute memory pointer to a buffer.

I might have explained it wrong. The memory area vill ofc be mapped inside the heap. But the address I need to pass to the DMA must be the absolute address since it can only target the entire memory.
by Ephreal
Mon Dec 30, 2019 7:26 pm
Forum: General Discussion and Questions
Topic: How to find the absolute memory pointer to a buffer.
Replies: 4
Views: 434

How to find the absolute memory pointer to a buffer.

My mypy resides in memory from where it is executed (no drive). I need to setup a DMA controller and for that I need to map an area of my entire memory (essentially outside the heap defined area) and write the start address to this DMA controller. How do I achieve this in mypy. Do I need to write my...
by Ephreal
Thu Nov 28, 2019 6:06 am
Forum: General Discussion and Questions
Topic: Does "__slots__" make sense in micropython
Replies: 8
Views: 772

Does "__slots__" make sense in micropython

Hi

Is there a difference in using __slots__ vs __dict__ in MicroPython. I am not familiar with the inner workings.

Regards
by Ephreal
Fri Mar 01, 2019 7:37 pm
Forum: General Discussion and Questions
Topic: Using the C API to pack a binary file into MPY
Replies: 4
Views: 690

Re: Using the C API to pack a binary file into MPY

dhylands wrote:
Fri Mar 01, 2019 4:34 pm
You probably want to use mp_obj_new_bytes rather than new_str. A str will be interpreted as UTF8 which means that some binary sequences will cause you problems.
Thank you. I have no overview on what macros are available.
by Ephreal
Fri Mar 01, 2019 3:35 pm
Forum: General Discussion and Questions
Topic: Frozen module
Replies: 1
Views: 464

Frozen module

Hi I am looking at our micro python build and am trying to figure out how it works. I want to put our modules in to compiled (frozen) map. But still maintain a memzip folder also. Can this be done. Also I cant seem to get it to compile my files in the folder I've set as the frozen folder. I've set #...
by Ephreal
Fri Mar 01, 2019 3:30 pm
Forum: General Discussion and Questions
Topic: Using the C API to pack a binary file into MPY
Replies: 4
Views: 690

Re: Using the C API to pack a binary file into MPY

Hi

Got it to work with

Code: Select all

STATIC mp_obj_t file_open(mp_obj_t filename) {
    void* data;
    size_t len;
    memzip_locate(mp_obj_str_get_str(filename),&data,&len);
    return mp_obj_new_str(data, len, false);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(file_open_obj, file_open);
thak you for your help
by Ephreal
Tue Feb 26, 2019 7:57 am
Forum: General Discussion and Questions
Topic: Binary file when there is no file system
Replies: 4
Views: 1001

Re: Binary file when there is no file system

gets expanded to 200 mb of source file or 200 mb of binary data? I'm assuming that you want that data to be stored in flash and not in RAM. Since you're not using frozen files, then you could have it encoded as a C source file, and then you can use a memoryview to access different portions of the d...
by Ephreal
Mon Feb 25, 2019 6:06 pm
Forum: General Discussion and Questions
Topic: Using the C API to pack a binary file into MPY
Replies: 4
Views: 690

Using the C API to pack a binary file into MPY

Hi I know there is a similar post out there but it does not clearly answer my question. I have been trying to get a binary file packed into my micropython build so that i could load it on my Nios cpu. I have not had much success in this. So now Im moving in another direction. Is it possible to make ...
by Ephreal
Mon Feb 25, 2019 4:21 pm
Forum: General Discussion and Questions
Topic: Binary file when there is no file system
Replies: 4
Views: 1001

Re: Binary file when there is no file system

You can store the binary file on the file system if there is enough space. I guess you didn't read my entire post Otherwise you might want to look at the font code that Peter Hinch (@pythoncoder) did over here: https://github.com/peterhinch/micropython-font-to-py which embeds binary font data into ...
by Ephreal
Tue Jan 15, 2019 1:49 pm
Forum: General Discussion and Questions
Topic: Binary file when there is no file system
Replies: 4
Views: 1001

Binary file when there is no file system

Hi I'm using Micropython on a Nios 2 Softcore from Altera. I somehow need to load a image file into a Flash. I've tried to wrap this file into a Python string which I then could load from the processor it self. However due to how a string is processed in MicroPython this was not possible. There is g...