foss-for-synopsys-dwc-arc-processors / embarc_osp

embARC Open Software Platform (OSP) - An embedded software distribution for IoT and other embedded applications for ARC
https://www.embarc.org/
BSD 3-Clause "New" or "Revised" License
70 stars 62 forks source link

How to read from sd memory? #160

Closed darko262 closed 3 years ago

darko262 commented 3 years ago

Hi i'm new I am working with THE starter kit with embarc_osp and I want to create a file, how can I create a file? How can I read from the SD card? fopen () doesn't create the file for me.

Another question is how do you use the network cable to connect to the internet with the board?

YuguoWH commented 3 years ago

Hi @darko262 , f_open() with FA_CREATE_NEW should be able to create a file. If you still have a problem, could you please give more detail? At present embARC OSP does not support wired internet access. There are several wireless methods instead.

darko262 commented 3 years ago

Hello, thanks for answering. the problem that does not ask me to define the variables, what libraries does FA_CREATE_NEW use? sorry if my questions are very naive libr

YuguoWH commented 3 years ago

Hi @darko262 , are you running one of the examples or it is your own project? The library is fatfs which has already port to embarc OSP, you could find it at embarc_osp/middleware/fatfs . Please note that in order to use fatfs, you'll need to select the middleware in your makefile. You could take embarc_osp/example/baremetal/bootloader/makefile as reference, see below https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp/blob/master/example/baremetal/bootloader/makefile#L32

# middlewares
MID_SEL = common ntshell ihex fatfs parson
abrodkin commented 3 years ago

@darko262 if the problem is solved for you now please let us know or close this issue yourself. If there're still questions on your side feel free to ask and we'll try to help you with them. Though if new questions are not strictly related to this one please open another issue so that we may track them properly and not miss important input of yours.

darko262 commented 3 years ago

Thank you so much!! problem solved