Format filesystem from linux (or image file to dd?

More
12 Jan 2014 00:41 #18388 by cstratton
Short Version:

Does anyone know a way to format the deviation filesystem with mkdosfs, or could anyone provide a raw image of a filesystem for Devo10 (or 7e) which I could install with dd?

Longer version:

I'm working on a port of Deviation to the STM32F3 discovery, with an sst25vf032 flash chip added to it.

I'm at the point in bootup where I need a valid filesystem on the flash, and I'm having trouble getting the mass storage stuff ported (in particular, the difference between the block sizes I can get mass storage to work with, and the erase size of the flash)

What I'd really like to do is be able to get an image file on my linux dev machine, and then upload it to the flash by alternate means, such as making a little program that just dumps usbcdc packets to the flash in order received.

I'm hearing that formatting the flash with linux is problematic; it seems to me that a valid filesystem formatted from windows could be copied back out with dd, loop mounted, erased, and compressed to a tiny size for distribution.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 00:53 #18390 by HappyHarry
it's 1am here so I can't do it just now, but if no one has done it by lunchtime tomorrow when I get home I'll dd the 7e usb drive for you

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 05:03 - 12 Jan 2014 05:12 #18397 by cstratton
Thanks, that would be really helpful to have a known good one.

I sort of faked a small FAT12 image and filled it up, and wrote some code to let me write to the flash.

But the sst25vf032 is not accepting writes. Really kicking myself because I've done a project with those before (why I had them on hand) and should have all the issues figured out. But not.

Wrote some code so I can manually send SPI commands. I'm unlocking the status register, clearing the BPL bits, enabling the write latch, and I think writing. But no matter what I (or the Deviation code) do, I never get back anything but blank memory. Yet I can read the status register and idcodes...

Problems it isn't:

1) The F3's determination of 8-bit or 16-bit SPI transfers based on SFR access width (already fixed that...)

2) Confusion over Deviation's inversion of all the data bits - ie, Deviation sees erased flash as 00 while I see it as ff, but it's the same issue in both programs. (Though I'll admit I'm still curious why that is done)
Last edit: 12 Jan 2014 05:12 by cstratton.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 06:05 - 12 Jan 2014 06:10 #18398 by cstratton
umpteen hours later, I notice that the ground lead to the flash daughterboard is soldered to the empty hole next to the ground pin and not actually to it Connect the grounds with a clip lead and suddenly my 2-byte test writes work.

And that's an old classic... circuits which "sort of" work when missing power or ground.

While the iron is hot, I'll add the decoupling caps, too.
Last edit: 12 Jan 2014 06:10 by cstratton.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 15:35 #18414 by HappyHarry
well you probably don't need it now lol, but here you go anyway :)

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 15:47 - 12 Jan 2014 15:57 #18415 by cstratton
Actually, I still do, so many thanks!

Deviation would mount my crafted filesystem, but it's complaining about missing bmp files (found in yours) so I'll need to debug that.

But it's really useful to have a reference of a known-good filesystem structure that works on an actual devo tx. (Incidentally, I tried erasing and zeroing a copy of yours to have just the structure, and it compresses down to 4k, which might really be viable for distribution if a perfectly reliable linux format command can't be found)

And then I just need to get it talking to this 1.8" color SPI LCD (conveniently the same resolution when initially ignoring color, and looks nice running Arduino demo code), transplant the old futaba sticks to a project box, wire it up, get minimal timers and interrupts going, transplant an RF module, and fly ;-)

(Once I get a working circuit I'll do a PCB smaller than the Discovery eval board, at which point transplanting the sticks won't be necessary, it would be more like a brain transplant to an existing older TX)
Last edit: 12 Jan 2014 15:57 by cstratton.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 16:28 #18418 by HappyHarry
so i take it your project is a complete tx? do you have a blog or anything showing your progres etc?

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 17:12 #18421 by cstratton
That's basically the goal, but I've only been working on it for a few days.

It will probably get it's own thread soon - this one was really going to be about formatting the filesystem from linux, or alternatives thereto.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 17:24 #18423 by PhracturedBlue
Replied by PhracturedBlue on topic Format filesystem from linux (or image file to dd?
Note that deviation inverts the data on the flash. that is because flash resets to 0xffff instead of 0x000, so to minimize writes, we invert each byte. this is the only reason you can't mount the devo FS in linux.
if you take a fat image and invert it, you can then upload it directly to the flash and it will work. Or rewrite the SPI-Flash driver (which I guess you need to do anyway) to work with non-negated storage, and then you can just straight use a fat image. It should be fat16. Note that petit-fat has been speficially coded to use a 4KB block size. switching back to 512 is possible,but you'll need to hack the code there as well. I also have a full chanfat system available (using it for the X9D).

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 17:25 #18424 by PhracturedBlue
Replied by PhracturedBlue on topic Format filesystem from linux (or image file to dd?
FYI, I've always wanted to do what you are doing. My goal was to convert my devo7 and wk2601 to Deviation. I just have never found the time.

Please Log in or Create an account to join the conversation.

More
12 Jan 2014 17:46 #18433 by cstratton
The inversion was not an issue, since I used the existing SPI routines which do it. It was just surprising - but thanks for explaining the reason. I got 4K blocks working, but my residual problem with mass storage is I think inherited from the example code I started with. I was trying for something cleanly libopencm3 without the legacy ST code in the existing one, though maybe adapting that to the ST code for the F3 would be more effective.

At any rate, I have a temporary workaround with a cdcacm based flasher mini-firmware I use with dd, so it's no longer a blocker for me.

I'm curious if you think the wk2601 as an enclosure with a brain transplant would be a good platform... they seem inexpensive. Is the existing LCD fixed function or pixelated?

Please Log in or Create an account to join the conversation.

More
13 Jan 2014 01:10 #18451 by PhracturedBlue
Replied by PhracturedBlue on topic Format filesystem from linux (or image file to dd?
You'll note that I use the ST USB code. That is because I had terrible reliability with the libopencm3 Mass Storage code. I really wish I didn't need to, but when I asked, I didn't get much help on the libopencm3 channel, and I just gave up and moved on.

The 2601 has a fixed-function display. I was actually working on the Devo7 1st. I planned to use a 320x240 screen with it. I fund one that fits with only slight modification to the case.

Please Log in or Create an account to join the conversation.

Time to create page: 0.051 seconds
Powered by Kunena Forum