preenfm Forum

PreenFM => preenfm2 and preenfm3 => Topic started by: ericd on November 12, 2020, 12:14:40 AM

Title: Bootloader 1.05 : SD card access
Post by: ericd on November 12, 2020, 12:14:40 AM
Moved by Xavier from an other thread



I hope this is the right place to post. It may be a very stupid question.

The PreenFM3 wiki says the SD card needs to be removed to put firmware files on it.

Is there a way to boot FM3 in USB disk mode (like FM2) to transfer the file to the SD card over USB?

I bought a pre-built FM3 from Ardi and there is no physical access to remove the SD card.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 12, 2020, 01:19:15 PM
The WIKI is right.
You currenlty have to remove the card as "SD card access" from computer is not implemented.

It's on my list, as it allows to cut the SD card so that it does not go beyound the box.

EDITED : will arrive soon  ;)
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 12, 2020, 11:40:06 PM
Thanks Xavier

That's good to know. I think I'll wait until that firmware update so I only have to take the case apart once.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 13, 2020, 10:39:51 PM
You can try bootloader 1.05 available from fiwmare 0.96 :
https://github.com/Ixox/preenfm3/releases/

To flash it without opening the enclosure, enter DFU mode with your current bootloader, then use WebDfu as explained here :
https://github.com/Ixox/preenfm3/wiki/Flash

With bootloader 1.05 you have an option (button 3) to make the SD card visible from your computer.
It very slow (up to 15 seconds) before seeing the volume on the computer.
But it should work to updoad new firmware and flash them with the bootloader.

Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 14, 2020, 01:27:46 AM
I'm trying to get past the first step.

I assume I can skip this bit as there is already bootloader 1.02 installed: Connect the boot0 pins with vcc on back side of the main PCB.

I hold menu while plugging the USB cable in. Select button 2 for DFU mode. The Preen screen says 'DFU mode' for a second then the screen goes blank. I don't have DC power connected, only USB.

This first time I did this my computer displayed a message saying it recognised a DFU device. The computer definitely sees "DFU in FS mode" connected.

Go to https://devanlai.github.io/webdfu/dfu-util/ using Chrome. When I click connect, there is no option for "DFU in FS Mode" only a list of 'unknown devices' none of which are DFU. I tested the process without the Preen connected to the computer and the list was the same, so I think this means WebDFU is not seeing the Preen.

I have tried on 2 separate computers running Win7 and Win10, both with the same result.

EDIT: the other thing I noticed is that when the PreenFM comes on (while holding 'Menu' button), there is a line of  random text below the options. I think this is where the firmware update files would be to choose from pressing + or -. I press - + and the line of text changes but it is always nonsense/random symbols.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 14, 2020, 09:06:52 AM
I hold menu while plugging the USB cable in. Select button 2 for DFU mode. The Preen screen says 'DFU mode' for a second then the screen goes blank. I don't have DC power connected, only USB.

The screen goes black when in DFU mode. That's expected.
USB only is OK.

This first time I did this my computer displayed a message saying it recognised a DFU device. The computer definitely sees "DFU in FS mode" connected.

This can also be checked in the device manager where an entry "DFU in FS mode" is listed under "peripherals USB" or something like this.
That's normal.

Go to https://devanlai.github.io/webdfu/dfu-util/ using Chrome. When I click connect, there is no option for "DFU in FS Mode" only a list of 'unknown devices' none of which are DFU. I tested the process without the Preen connected to the computer and the list was the same, so I think this means WebDFU is not seeing the Preen.
I have tried on 2 separate computers running Win7 and Win10, both with the same result.

Aouch... I have no idea how that can happen ?
Double check you're using : "An up-to-date version of Chrome, at least version 61 or newer" As required.
(Edited : if the other devices are listed, it means it's OK)

Did you install STM32 DfuSe already ? (the second solution listed on the wiki)


EDIT: the other thing I noticed is that when the PreenFM comes on (while holding 'Menu' button), there is a line of  random text below the options. I think this is where the firmware update files would be to choose from pressing + or -. I press - + and the line of text changes but it is always nonsense/random symbols.

Yes should be the firmware.
SD card compatibility have been improved in the latest versions.

I've put together a zip file where you have dfu-util and the latest zip file.
Once the preenfm3 in DFU mode, can you try to run the command after unzipping the folder ?
https://drive.google.com/file/d/1Qo1uxiSbUCAC4h2ZAjQswPRdJVRzq9uX/view?usp=sharing
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 14, 2020, 09:15:00 AM
So I should run the file called 'dfu-util'?

Quote
Did you install STM32 DfuSe already ? (the second solution listed on the wiki)

No - I read that and it just looked too complicated for me to understand ??? Do I need that to try your file?

EDIT: I tried running dfu-util. A text box flashed briefly on my computer monitor then closed.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 14, 2020, 10:02:30 AM
EDIT: I tried running dfu-util. A text box flashed briefly on my computer monitor then closed.

No you don't need DfuSe, i asked because sometime it change the drive for DFU and the WebDfu solution does not work because of that.

You need to run the cmd files which calls dfu-util.
There's a README file in the zip  ;)

From a terminal you can try "dfu-util -l" which list the device available.

Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 14, 2020, 10:24:46 AM
Thanks for your patience, I really am not a 'computer person' past simple things- I'm trying!

Can I just make sure I am right about this part- I can connect FM3 to the computer with the USB cable and boot to DFU mode. I don't need to do this: 
To do so, put a jumber on the boot0 bins between center pin and Vcc, and switch on your preen.

I ran the commands as per the readme, first the booltoader. The cmnd window only flashed up for a second or two. Then the same with the firmware cmnd, the same thing. I checked just in case, the bootloader is still 1.02.

EDIT The cmnd file is called 'flash_bootloader' and in the READ ME it's called 'install_bootloader'- I don't know if that matters?

I entered "dfu-util-l" into a termina, , it says it is not recognized.

EDIT: what does this instruction mean please? Opon a commmand term and cd into this folder.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 14, 2020, 10:43:08 AM
Thanks for your patience, I really am not a 'computer person' past simple things- I'm trying!

No problem.
I don't plan to flash the PCBs i sell, so i must understand and find a solution for all flash problems one can have.


Can I just make sure I am right about this part- I can connect FM3 to the computer with the USB cable and boot to DFU mode. I don't need to do this: 
To do so, put a jumber on the boot0 bins between center pin and Vcc, and switch on your preen.

No you don't need to.
Both action lead to the same state :
. put a jumber on the boot0 bins between center pin and Vcc, and switch on your preen.
. Enter the preenfm bootloader and click on the DFU button

I ran the commands as per the readme, first the booltoader. The cmnd window only flashed up for a second or two. Then the same with the firmware cmnd, the same thing. I checked just in case, the bootloader is still 1.02.
I entered "dfu-util-l" into a termina, , it says it is not recognized.

 :-\  Windows does not see correctly the DFU mode.
And you have the same behavious on both your PC ?


Can you try what follows.
This comes from the official dfu-util site :
https://github.com/libusb/libusb/wiki/Windows#How_to_use_libusb_on_Windows

We'll use Zadig (https://zadig.akeo.ie/) to try to fix the driver.
Download and  install it.

Once it done, try again to run the command.
Thanks
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 14, 2020, 11:09:41 AM

And an other solution is to try to uninstall the current driver for the "Dfu" device.
https://github.com/pbatard/libwdi/wiki/FAQ#Help_Zadig_replaced_the_driver_for_the_wrong_device_How_do_I_restore_it
It's possible that Windows will automatically install a working one after.

Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 14, 2020, 11:20:08 AM
Quote
Can you try what follows.
This comes from the official dfu-util site :
https://github.com/libusb/libusb/wiki/Windows#How_to_use_libusb_on_Windows

We'll use Zadig (https://zadig.akeo.ie/) to try to fix the driver.
Download and  install it.
  • Enter DFU mode on your preenfm
  • Launch Zadig.
  • Option > list all devices
  • Select your DFU device.
  • For it, select WINUSB drivers. Click replace driver.

Once it done, try again to run the command.
Thanks

This works! Bootloader is now 1.05 and firmware is 0.96.

The only remaining problems I see is the text about the firmware version is still random symbols,

and when I enter SD card access mode (button 3) my computer asks me to format the disk. Should I say yes or no?
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 14, 2020, 11:25:39 AM
This works! Bootloader is now 1.05 and firmware is 0.96.

Awesome  :D

The only remaining problems I see is the text about the firmware version is still random symbols,
and when I enter SD card access mode (button 3) my computer asks me to format the disk. Should I say yes or no?

Oh no  :(
No don't format the disk.
Can you read and save preset in the firmware ?

Do you knw what SD card is in your preenfm ?
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 14, 2020, 11:32:16 AM
Yes I can read and save presets.

I don't know about the type of card, sorry- you would have to ask Ardi @ Van Daal.

I've emailed him to ask.
Title: Re: Bootloader 1.05 : SD card access
Post by: Megalomidiac on November 15, 2020, 02:12:01 PM
I also had the problem with flashing 1.01 on my new PreenFM3 with the Chrome browser, so I choose DfuSe. That worked.

But the new Bootloaders are in .bin format, could you please offer the .dfu format, too @Xavier ?
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 15, 2020, 03:25:05 PM
Just added a dfu file in
https://github.com/Ixox/preenfm3/releases/tag/v0.96

I cannot try it as i don't want to reinstall DfuSe driver, i prefer the cmd way.
Let me know if it works
Title: Re: Bootloader 1.05 : SD card access
Post by: Megalomidiac on November 15, 2020, 03:33:21 PM
Thank you, it worked!
I think I also will have to replace the dfu driver under Windows 10 to get use of the cmd option.
Title: Re: Bootloader 1.05 : SD card access
Post by: served on November 16, 2020, 08:54:55 AM
Yes I can read and save presets.

I don't know about the type of card, sorry- you would have to ask Ardi @ Van Daal.

I've emailed him to ask.

The SD card is SanDisk Ultra SDHC 16GB
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 16, 2020, 09:04:02 AM
Ha- thanks. Just logged in to post that  :)


Edit: some more details. I have tried on PC's running Win7 and Win10. For both, the Preen FM3 text display, where the name of the firmware file should be, is junk text/symbols. When I enter SD card mode, the FM3 display shows the letter R with a spinning '/' symbol.

On the Win7 PC, it says "format the drive'. On the Win10 PC, it says 'Enter a disk in USB Drive D'. It recognizes a STM32 USB mass storage device but I can't actually access it: if I try I get the 'enter a disk' message.

Not sure if it helps but I figure the more info I can provide the better.
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 18, 2020, 12:27:32 PM
Xavier, do you think in time the compatibility issue with this SD card for SD access mode can be fixed?

Or is it more likely that the card will need to replaced with a different model?

The obvious limitation is not being able to backup my patches (or import patches to try out), or do future firmware updates via SD mode. Everything  'internal' to the synth itself seems to be working fine so far in 0.96.

Personally I find creating patches in the FM3 quite enjoyable. I had gotten used to the FM2 interface, but the FM3 display makes it really easy to see what's going on. I will really give it a workout when my OT comes back from repair. 
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 18, 2020, 10:20:13 PM
Xavier, do you think in time the compatibility issue with this SD card for SD access mode can be fixed?
Or is it more likely that the card will need to replaced with a different model?
The obvious limitation is not being able to backup my patches (or import patches to try out), or do future firmware updates via SD mode. Everything  'internal' to the synth itself seems to be working fine so far in 0.96.
Personally I find creating patches in the FM3 quite enjoyable. I had gotten used to the FM2 interface, but the FM3 display makes it really easy to see what's going on. I will really give it a workout when my OT comes back from repair.

The Sandisk Ultra is perfect.
I have this one. It's the first one i used and it always worked well.
Would be great if you can open your enclosure, take the card, put it directly in a computer, backup it, re format it, copy back the /pfm3/ forlder on it, and put it back in the preenfm.

I really expect that to fix your problem. And you'll have a backup on your computer ;)
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 19, 2020, 05:05:55 AM
Ok- thanks I'll give it a try. Are the any particular options I will need to select when formatting the SD?
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 19, 2020, 05:48:29 AM
I did as suggested. Reformatted the card FAT32, 32kb, The result is the same. When I hold menu and power up the machine, this is the display attached.  The PC still says, when I go into SD mode, that I need to format the disk.

I tried another SD card I had lying around- I think it's pretty old- Lexar Platinum II SDHC 16GB 300x 45 MB/s. I put the FM3 folder on it, when I booted up the Preen display said 'SD CARD ERROR'

I don't know if this helps at all; SETTINGS.txt contains this:

# Usb Midi
#   0=Off, In, In/Out
usbmidi=2

# Receives
#   0=None, CC, NRPN, CC & NRPN
midireceives=3

# Sends
#   0=None, CC, NRPN
midisend=2

# Program Change
#   0=No, Yes
programchange=1

# Boot To
#   0=Default, Bank, Mixer, DX7
boot=0

# Encoder Driver
#   0=12, 24, 12i, 24i
encoders=1

# Test Note
testnote=60

# Test Note Velocity
testvelocity=120

# Arp in Preset
#   0=No, Yes
arpinpreset=0

# Unlinked edit
#   0=No, Yes
unlinkededit=0

# Boot Sound
#   0=No, Yes
bootsound=0



Can I ask- bootloader 1.05 is now on the Preen itself- not on the SD Card? If I try a brand new SD card with the FM3 folder will 1.05 still be installed on the Preen? (sorry for my ignorance- as I said before I am really not a computer person)
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 19, 2020, 06:19:00 AM
I did as suggested. Reformatted the card FAT32, 32kb, The result is the same. When I hold menu and power up the machine, this is the display attached.  The PC still says, when I go into SD mode, that I need to format the disk.

I tried another SD card I had lying around- I think it's pretty old- Lexar Platinum II SDHC 16GB 300x 45 MB/s. I put the FM3 folder on it, when I booted up the Preen display said 'SD CARD ERROR'

Can I ask- bootloader 1.05 is now on the Preen itself- not on the SD Card? If I try a brand new SD card with the FM3 folder will 1.05 still be installed on the Preen? (sorry for my ignorance- as I said before I am really not a computer person)

Oh i just gave a try without bin files and i have the same bug.
You have to copy at least one bin file on the root folder of the SD card : "/".

What i don't understand is the computer that asks you to format... What OS do you have ?
Can you try the SD access with a bin file in the root folder, so that it displays the name correctly.

Did you format the Lexar SD card before copying the SD card ?
It's suggested to use the official SD formater to use with embedded hardware, they are more strict than windows.
https://www.sdcard.org/downloads/formatter/

Yes, the bootloader and the firmware are on the preenf3, not on the SD card.


Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 19, 2020, 06:24:34 AM
The FM3 folder has two bin files

I'm on Win7.

I can try to reformat the Lexar card it was just empty and I have no memory of what I ever used it for!

EDIT- reformatted the Lexar SD card with their program. Same result when I hold menu and boot  'SD Card Error'.

When I reboot into normal mode, I can load and save patches.

But if boot straight into into normal mode from off, I cannot access the patches.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 19, 2020, 06:32:30 AM
The FM3 folder has two bin files

bin files must bin the root folder of the SD card, not in /pfm3/.
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 19, 2020, 06:45:39 AM
OK- that has fixed the display issue with the Sandisk card!

But not the Lexar - still gets 'SD Card Error' in the same spot where the junk text was with the Sandisk.
Let's forget about the Lexar card for now!

With the Sandisk- Still having the SD card access problem on win 7 and win 10.

I don't understand why it's fine when I remove the card and put it in a card reader, the computer reads it perfectly, can save files to it etc. But when in SD Access mode in the Preen, the computer thinks it needs to be formatted.

EDIT - after the PC says to format the card, if I wait a moment before I press cancel a message pops up:

E:/ is not accessible.
The volume does not contain a recognised file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

I tried reverting to firmware 0.95 but that made no difference either.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 20, 2020, 08:51:43 AM
With the Sandisk- Still having the SD card access problem on win 7 and win 10.

I don't understand why it's fine when I remove the card and put it in a card reader, the computer reads it perfectly, can save files to it etc. But when in SD Access mode in the Preen, the computer thinks it needs to be formatted.

The SD card access from the computer is complicated.
The preenfm register itself to the computer as a Mass storage USB device, then it redirects all the low level Storage access to the SD card in SPI mode.
Computers have very robust drivers and don't have to deal with SPI mode of SDCARD. (web search for more detail ;) )

I have many combinations to try.
Linux/MacOS/Windows and all SDcard have some small differences.

I confirm that "Windows + Sandisk Ultra" does not work for "SD card access from computer". But works with the rest.
Will have a look this week end.

I tried reverting to firmware 0.95 but that made no difference either.

I'm not surprised, the firmware has nothing to do with the bootloader  ;)
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 20, 2020, 09:29:40 AM

Will have a look this week end.


Thanks Xavier.

EDIT- is there a current list of SD cards that are now fully compatible with 0.96?
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 20, 2020, 10:03:16 AM
EDIT- is there a current list of SD cards that are now fully compatible with 0.96?

No sorry.
I've just added the "SD card acces from computer" feature and don't have enough data to make a list.
I hope to have that in the near future.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 22, 2020, 05:51:18 PM
I confirm that "Windows + Sandisk Ultra" does not work for "SD card access from computer". But works with the rest.

This should be fixed with bootlader 1.06.
There were a problem with windows and SD cards > 4Gb.

Curent state :
It's super slow, be patient.
. Windows work fine.
. MacOs does a lot of Write on the SD i have no idea why and is even slower.
But i could access my SD cards with these 2 os.
Title: Re: Bootloader 1.05 : SD card access
Post by: ericd on November 22, 2020, 11:27:16 PM
I installed the new bootloader with webdfu and it is now 1.07  ;D

Just thought I would report this message came up in webdfu: maybe it doesn't matter because the bootloader is now 1.07 anyway.

Firmware Download (write to USB device)

p3_boot_1_07.bin


Erasing DFU device memory


Copying data from browser to DFU device


Wrote 65744 bytes

Manifesting new firmware

DFU GETSTATUS failed: ControlTransferIn failed: NetworkError: A transfer error has occurred.

Done!
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 23, 2020, 07:25:49 AM
Incredible. So I guess I can follow the same process with Zadig to install 1.06 and then 0.97? Will give it a try tonight.

If you already used zadig to "fix" your driver, you should be good. Only required once.
Title: Re: Bootloader 1.05 : SD card access
Post by: Xavier on November 23, 2020, 07:44:21 AM
I installed the new bootloader with webdfu and it is now 1.07  ;D
Just thought I would report this message came up in webdfu: maybe it doesn't matter because the bootloader is now 1.07 anyway.

If the bootloader is now 1.07. Then it worked.
I think WebDfu tries to reboot the preenfm at the end and fail.

I really hope i won't have to publish new bootloader for a while  ;)