VS1000 with 16M/128MBIT SPI flash

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
afkool
User
Posts: 2
Joined: Thu 2021-07-01 19:11

VS1000 with 16M/128MBIT SPI flash

Post by afkool »

(Jump to third paragraph to skip some intro)

First post here and new to developing on the VS1000. I picked up an audio module from Adafruit that is similar to the VSMD001. The stock firmware provided almost fit my needs but I ended up wanting to make some changes. I did a little research and knew their specific firmware was closed so I'd have to work off the VSMD001 firmware or the modified version that Sparkfun's audio module was using.

I was able to make my adjustments to the Sparkfun code (VSMD001 base) and flash it from VSIDE using UART. I was working off a second board that had a smaller 2M flash. Easier to develop because the 16M version of the board I had already physically embedded into my project, makes it annoying to flash during dev.

(TLDR start here)
When I was happy with my firmware and it worked on the 2M board, I increased the CHIP_TOTAL_BLOCKS and flashed to the 16M board but it no longer worked. I pcflashed (pcflash.exe -l) the Adafruit firmware and it worked fine so I didn't brick anything that I can tell. After playing around with my code, I figure either I'm not changing enough to configure it for 16M or I'm doing something else wrong.

I tried to configure a smaller SPI flash size, using the 2M to start and it worked then. So I kept increasing to 4M, 12M, 15M, each time I had to re-format the partition but it was functional with my firmware. Once I flashed the 16M config (32768 total blocks), it would stop functioning and after that I had to re-flash the Adafruit firmware to even use the lower sizes. I also noticed differences in allocation unit size between the firmwares that Windows would format it as, 512 bytes vs 4096 (without option to go lower).

I have a feeling I'm either not configuring enough to switch to the larger flash, or I'm not flashing "enough." I did try to search around and read up on some older threads but I couldn't put together enough info to see what I could be doing wrong.

[edit] The flash on this board is the GD25Q127C

Thanks for the help,
Antoni
User avatar
pasi
VLSI Staff
Posts: 2174
Joined: Thu 2010-07-15 16:04

Re: VS1000 with 16M/128MBIT SPI flash

Post by pasi »

Hi,

The reasons:
a) the block number in the code is a 16-bit variable/parameter in the code, thus can only address 32MB of 512-byte blocks. Possibly it doesn't work for you for 16MB due to signed/unsigned not being thought out as well as it could. In that case, setting CHIP_TOTAL_BLOCKS to 32767 might do the trick (just a tad short of 16MB). The newest VS1000 Audio Module firmware does support 16MB.
So, compare to the code in VS1000AudioModule-072b-VSIDE.zip you can find from http://www.vlsi.fi/en/support/software/ ... tions.html
b) the SPI READ command only has 24-bit address and addresses bytes, thus only being able to address 16MByte.

Larger SPI FLASHes have additional 4READ and 4PP and 4SE commands. The VS1000 Voicemail firmware supports larger memories (tested with 64MByte). EDIT: that too seems to only support reading, i.e. preprogrammed content.

I have an unreleased version of the VS1000 Audio Module firmware which supports the 4READ SPI command (32-bit address) and thus supports larger memories. It only uses the 4READ command if the block number is >=0x8000, so the code is compatible with smaller memories. The newer code also determines the SPI FLASH size automatically and you don't need to set the CHIP_BLOCKS by adjusting the define.

However, unfortunately it seems the USB mass storage code hasn't yet been updated. (The content can be programmed from the uSD card though.)

I'll take a look and see if I can locate the module that has the 64MB memory (S25FL512S) to finish the project.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
afkool
User
Posts: 2
Joined: Thu 2021-07-01 19:11

Re: VS1000 with 16M/128MBIT SPI flash

Post by afkool »

Thanks for the information.

I didn't try 32767 but I can give that a shot. I've been working off this SFE firmware which has some of the VS1000AudioModule code ripped out and changed around a bit, I assume removed instead of just having undefined features as to not confuse users of their board.

At this point I think I've learned enough of the code that I should probably switch over to the latest VS1000AudioModule and use that as my base instead of the SFE. That would ensure I have the latest version that you mentioned.

Supporting more than 16MB might be nice in the future or perhaps someone else is already interested but at the moment, 16MB is enough for me.

Thanks,
Antoni
Post Reply