Nand flash overlays for VS1000 - COMMENTS WELCOME!

Installing and using VSIDE tools for VLSI Solution's devices that contain a VSDSP signal processor.
User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Tue 2011-06-28 18:44

Hi!

Here's a first alpha version of Overlay support for VS1000 + Nand Flash.
It compiles in VSIDE, but VSKIT is needed to burn the nand flash.
There's a README File in the package, please see it :)

Please test it and I would be VERY grateful to hear your comments and suggestions!

-Panu
Attachments
NandOverlay.zip
Nand Flash overlays for VS1000
(110.74 KiB) Downloaded 547 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Wed 2011-06-29 15:43

Hmmh, the default NANDPROG for VS1000 doesn't work with overlays.. You need to prom the NAND image with spares, because the overlay loader uses error correction. Attached is a version of the NANDPROG.C which also writes the spares when it writes the image. So use this NANDPROG.C instead of the one from the vskit package when you write the boot image to VS1000 Nand Flash using VSKIT command line tools.

I'm not sure which size nand flash ICs this nandprog.c supports.. If you're having trouble programming the code, compare the output of the nandprog program (nandtype, size, block size) to the version of nandprog.c, which has worked for you earlier without overlays.

-Panu
Attachments
nandprog.c
nandprog.c which also writes the error correction info when programming boot image to the nand flash
(8.62 KiB) Downloaded 506 times
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

denizfer
User
Posts: 14
Joined: Wed 2012-07-18 14:27

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by denizfer » Wed 2012-07-18 14:55

Hello,

In one of our projects we're using VS1000 with a NAND Flash and want to use overlaying. I have downloaded and tried your sample codes and they work on developer board. I tried to add another overlay module with 2 new functions with contents same in the example. Compile fails even if I tried rebuild solution multiple times and it cannot combine the images into "eeprom.img". "post-last1000.bat" batch file checks the image for inconsistencies and it finds that my second overlay module's start address is wrong (18 is not -1)
Can you help?

Thank you, best regards,
Deniz

User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Thu 2012-07-26 16:17

Hi, have you renamed the module and added its info to the control file? Actually, can you post your project here (please remove any secrets) and I can take a look at it.

Also, please check that the module which has the post-last.bat post compile scritpt actually is the last one to compile!

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

denizfer
User
Posts: 14
Joined: Wed 2012-07-18 14:27

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by denizfer » Wed 2012-08-01 9:01

Hello Panu,

I found the solution. It seems a problem with OS, I've run VSIDE as administrator and the problem is gone and overlaying works wonderfully :D

Except one thing :cry: when I try to move the following code into one of the modules it creates garbage data in the screen.

Code: Select all

void ScreenPutDoubleData(u_int16 c){
  register u_int16 d;
  register u_int16 i;

  d=0;
  for (i=0; i<8; i++){
    d <<= 1;
    d |= ((c & 0x80) >> 7);
    d <<= 1;
    d |= ((c & 0x80) >> 7);
    c <<= 1;     
  }
  i = lcdControl.X;
  LcdPutData(d);
  LcdPutData(d);
  if( lcdControl.X < i )
    LcdLocate( i, lcdControl.Y );
  else
    LcdLocate( i, lcdControl.Y + 1 );
  LcdPutData(d>>8);
  LcdPutData(d>>8);
  if( lcdControl.X > i )
    LcdLocate( lcdControl.X, lcdControl.Y - 1);
}
Yes, that's from one of the example codes you have provided in the website. I have modified it a little to have wrapping.

Thank you for your help.

User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Wed 2012-08-01 10:08

Hi!

Great that you're making progress...

About your problem (screen garbage): could it be that it tries to change the overlay when the screen CS is selected? It's important to keep all the display functions in the same overlay. If necessary, you can copy any necessary small helper functions (LcdPutData and LcdLocate) into each overlay (it's called leaf function duplicating) to make them callable from the same overlay. You don't need to declare them as entry functions.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

denizfer
User
Posts: 14
Joined: Wed 2012-07-18 14:27

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by denizfer » Thu 2012-08-02 8:18

Hello Panu,

Sorry I've given you little information. I'm working on VS1000D developer board and using dev1000 library for LCD functions.
I've checked it again from code overlay memory map tool and tried several other aproaches.
After placing this function into one of my modules I can see from the map tool that dev1000 functions are duplicated under every module I use them.
But there's a problem with the most basic function among them, LcdPutData. Apperantly the data displayed on LCD is not garbage but original data XORed with another static data(which changes after every re-compile).
On the other hand if I place a dummy line to use LcdPutData in the static module, it stops leaf function duplication and LcdPutData function starts to work properly. In the mean time every other LCD function is inside other modules.

Could this be a problem with the LcdPutData function or related to overlaying?

Thank you for your help.

User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Fri 2012-08-03 9:55

Hi!

Hmmh, sounds weird... so LcdPutData function is duplicated in each overlay? But could it still do some overlay change in the middle of screen operation? Can you check with the serial port monitor to find out?

Hmmh, maybe it is a speed or GPIO mode problem... can you edit the LcdPutData function to be a little slower (duplicate some line(s) of code), and to be sure it sets the GPIO MODE and DDR registers always... it could be that the GPIO state is set to some value after each nand flash operation, the GPIO state is somehow reflected in the data, e.g. maybe there is too much capacitive load on the traces (electrical problem) or the GPIO state is saved wrongly at some point (software problem)..

Maybe it would help to write the GPIO0..7 pins low before the operation (write 0x00FF to the GPIO0_CLEAR_MASK register) or high (write 0x00FF to the GPIO0_SET_MASK register) if it is a problem with trace capacitance..

:?

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff
Posts: 2782
Joined: Tue 2010-06-22 13:43

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by Panu » Fri 2012-08-03 9:57

Hmmh, are you doing some GPIO code inside an interrupt? Because that would probably mess up the LcdPutData...?

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

denizfer
User
Posts: 14
Joined: Wed 2012-07-18 14:27

Re: Nand flash overlays for VS1000 - COMMENTS WELCOME!

Post by denizfer » Fri 2012-08-03 12:21

Well, the OLED on developer board is driven through SPI and no GPIO is used during its operation(I suppose).
I have also checked from the serial port and it does not change overlays during LCD operation.
I don't have an interrupt. Only 5 keys and GPIO5 is set to check battery level(which is in a different module and called every second).

I've also replaced the LcdPutData function with code from the display example(along with changes for the example code to work along with other dev1000 library functions), which is also placed inside the same module. This time, it works fine. So I'm suspecting, LcdPutData is trying to access something out of reach. May be something in its code is limiting the function to be run on modules? :?

Post Reply