/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / OS 3.3 filesystem support

Username:     
Password:     
             

Forum

# 1   2009-01-16 08:38:23 OS 3.3 filesystem support

FR4
Member
Registered: 2008-11-09
Posts: 26

OS 3.3 filesystem support

Does Circle OS 3.3 support a filesystem? I can´t find any hints in documentation.
I just want to read out a fat32 sd-card on the primer2.
Any tips?

Thanks
FR4

Offline

 

# 2   2009-01-16 09:01:16 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

Not yet. But Raisonance does not work on this task and we expect that someone in the community will implement this feature (to be added to CircleOS). If you are interested....

Offline

 

# 3   2009-01-16 10:46:15 OS 3.3 filesystem support

FR4
Member
Registered: 2008-11-09
Posts: 26

Re: OS 3.3 filesystem support

Hmmm...I would like to. But i´m afraid i will fail on implementing, because i don´t have the ride pro version.
And i suppose 32kb is not enough to implement a fat filesystem. So i you have one pro version spare....

Offline

 

# 4   2009-01-16 11:34:58 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

If we send you the key to convert your Primer in PRO version, you accept to work on the filesystem? Good deal...

Offline

 

# 5   2009-01-17 14:39:24 OS 3.3 filesystem support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: OS 3.3 filesystem support

there are some FAT16 implementations (read+write) for atmega out there, GPL licensed.

oh, and this http://www.st.com/mcu/forums-cat-7702-2 … p;start=10 might contain a working version for arm.

Last edited by zwieblum (2009-01-18 13:12:45)

Offline

 

# 6   2009-01-20 10:45:15 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

I also got (from ST) the following link :
http://elm-chan.org/fsw/ff/00index_e.html

Offline

 

# 7   2009-01-21 06:09:45 OS 3.3 filesystem support

FR4
Member
Registered: 2008-11-09
Posts: 26

Re: OS 3.3 filesystem support

You´re right. There are many filesystems out there. But what about licensing. Can we use software under GPL? What about long filenames? If you intend to read mp3 files, it´s somewhat essential. Vfat is imho patended.

Offline

 

# 8   2009-01-21 08:59:24 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Another good one: http://www.larwe.com/zws/products/dosfs/
Seems to have no licensing at all.  You can work without Vfat for the time being but i agree it would be nicer
to have vfat so mp3 filenames can be displayed properly... or jou just read the ID3 tags.

Offline

 

# 9   2009-01-21 20:57:30 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Is it correct that there also isn't SDIO support within circleOS?
Ofcourse the functionality in the STM32 firmware lib helps a lot but we still need to implement the state machine, etc.


If not I need to dig up some "old" code and manuals..

Last edited by sjoerd (2009-01-21 20:59:28)

Offline

 

# 10   2009-01-22 08:28:50 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

Yes... We just made some basic tests (for the factory tests of the hardware), but , at the moment, we didn't integrate any SDIO function in CircleOS.

Offline

 

# 11   2009-01-22 18:37:23 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

This seems an interesting starting point to save a lot of time: http://www.st.com/mcu/forums-cat-7702-2 … p;start=10

I'm currently trying to get this implementation to work.

Offline

 

# 12   2009-01-22 21:24:04 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Got it working. I can read out the fat table and display 8.3 filenames on the screen.

First crappy 'lots of code uncommented' version here: http://rcpt.yousendit.com/645009986/ccc … 85ecf40e40

This project includes the SDIO driver and DosFS and calls the main function of the earlier mentioned project.


I'll continue testing to see if read/write is ok, performance is ok.

this implementation uses a 1 bit wide interface so it makes sence to change it to 4 bit.



to be continued..

Last edited by sjoerd (2009-01-23 07:16:43)

Offline

 

# 13   2009-01-22 22:19:19 OS 3.3 filesystem support

zwieblum
Member
Registered: 2008-12-19
Posts: 68

Re: OS 3.3 filesystem support

Sounds great! Keep us informed big_smile

Offline

 

# 14   2009-01-23 22:53:35 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Just converted a JPG to the ST7637 color codes, put it on a the flash card, read it with DosFS and display it.

http://i40.tinypic.com/1z4hauv.jpg


(It's mirrord that's probably caused by my conversion)

Block reading can be confirmed.
On the background the root of the disk is displayed

Please let me know if anybody is interrested in intermediate zip files containing the code.

to be continued

Last edited by sjoerd (2009-01-23 22:54:46)

Offline

 

# 15   2009-01-24 04:22:26 OS 3.3 filesystem support

FR4
Member
Registered: 2008-11-09
Posts: 26

Re: OS 3.3 filesystem support

Yes, please post the intermediate files also.

Offline

 

# 16   2009-01-24 06:33:39 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

test project can be downloaded here: http://www.yousendit.com/download/WnBSR … bHgzZUE9PQ

Offline

 

# 17   2009-01-24 08:07:36 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

C# .net Code i've used to convert a jpg to ST7637 color space. I guess the problem of the mirrord image is that a windows bitmap starts from bottom up..

Bitmap b = new Bitmap("D:\\temp\\image.jpg");
           
            Int16 pixel;

            using (BinaryWriter bw = new BinaryWriter(File.Open("D:\\temp\\image.prm", FileMode.Create)))
            {

                for (int i = 0; i < b.Width; i++)
                    for (int j = 0; j < b.Height; j++)
                    {
                        Color c = b.GetPixel(i, j);
                        pixel = (short) (((c.G & 0x07) << 13) + ((c.G) >> 5) + (((c.B) >> 3) << 8) + (((c.R) >> 3) << 3));
                        bw.Write(pixel);
                    }
            }

Last edited by sjoerd (2009-01-24 08:10:13)

Offline

 

# 18   2009-01-24 14:58:39 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

Note that "http://www.stm32circle.com/projects/project.php?id=52" is very good to convert jpg to '.h' files. Now it would e nice to extend it to convert jpg into raw binary files. At the end, the best would be to convert jpg into CircleOS...

Offline

 

# 19   2009-01-24 15:09:46 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Yes,  I'm also looking for a light weight JPG decoder so it can be done from the Primer2 'explorer'/jpg viewer.

There are loads of them

this one looks ok:
http://www.saillard.org/programs_and_pa … egdecoder/


perhaps there are better alternatives?

Last edited by sjoerd (2009-01-24 15:10:34)

Offline

 

# 20   2009-01-24 20:15:47 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

To add such algorithm in CircleOS, it seems that we have first to add a memory allocator. Anyway, it would be good to test first a JPEG decoder as a CircleOS application, and if it works we could then integrate it into CircleOS.

I don't find the exact amount  of memory required for decoding an image but I believe that it builds the image in RAM. The Primer2 has no external RAM, and the MCU embeds 64KB of RAM. It would be nice to display 128X128 pixels (16K pixels). The linked algorithm manages several modes: 24 bit (i.e. 48KB). But 48KB would be too much. I see in the source file another mode: TINYJPEG_FMT_YUV420P that seems to consume twice less memory. That would fit in the available memory.

Offline

 

# 21   2009-01-24 23:45:08 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

New version with an abstraction layer on top of the DosFS to make the interface a cleaner.

Get it here: http://www.yousendit.com/download/WnBUb … eUpMWEE9PQ

I performed some speed measurements and first results show a 575kb/sec read when reading the same 25k block over and over again.
There could be some caching somewhere so more tests are needed to give a better view on the performance.


all feedback is welcome wink

Offline

 

# 22   2009-01-26 22:17:08 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

New version with experimental file browser.

I'm having trouble getting 3 directories deep and perhaps more issues in this version.. i'm working on it wink

Get it here (for Primer2)
http://www.yousendit.com/download/WnBTa … YVBIRGc9PQ

Offline

 

# 23   2009-01-27 09:26:54 OS 3.3 filesystem support

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: OS 3.3 filesystem support

After a few tests:  it works very well as an explorer... Congratulations!

Offline

 

# 24   2009-01-27 09:41:28 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

Thanks.

There are a lot of optimizations possible.

- don't display "."
- add hooks for several file extensions
- max number of entries in list
- etc etc


For now it's a proof of concept that should be cleaned up (that's going to be the next step)

Offline

 

# 25   2009-01-31 11:59:41 OS 3.3 filesystem support

sjoerd
Member
From: Stad aan het Haringvliet
Registered: 2008-09-04
Posts: 65

Re: OS 3.3 filesystem support

I've added a new project that implements a simpel file explorer:
http://217.71.112.106/stm32circle/proje … .php?id=56


It uses a modified version of CircleOs 3.3 with integrated SDIO driver and DosFS silesystem.


I would like to make a suggestion for an image format we can use to display images.

For now i've called it .prm and the format is:

8 byte header:
- header[0]: height
- header[1]: width
- header[2] - header[7] future use

pixeldata :

2 bytes per pixel: (((green & 0x07) << 13) + ((green) >> 5) + (((blue) >> 3) << 8) + (((red) >> 3) << 3));

first line of data starts at (height, widht) 0,0 to 0,width
2nd line of data: 1,0 to 1,width
etc;

Offline

 

Board footer