Deutsch English

Using roloFlash without SD Card

If your required files together are smaller than the Flash disk (see manual, currently 640 kBytes for V07.AA), you can copy everything to the Flash disk and then use roloFlash without an SD card. This gives you the following advantages:

We recommend the following procedure:

Using roloFlash without SD card

1. Testing with SD card

First test your procedure as usual using an SD card. You will have a RUN_V07.BIN on the SD card to execute, and probably also one or more files to flash. For simplicity, we will refer to FLASH.HEX from here on.

2. Preparing the SD card to transfer all files into roloFlash

Create a folder named TO_RF on the SD card and copy all necessary data from the previous step into this folder.

Also, create a file RUN_V07.BIN in the root directory of the SD card, which is supposed to copy the data from the TO_RF folder to the Flash disk. You can find the copyFile procedure for this purpose at the end of this document in the appendix. Copy this procedure into your roloBasic file, e.g. like so:

! -- copy "FLASH.HEX" from SD-card (folder TO_RF) to FlashDisk (root folder):
copyFile SDCARD, "TO_RF/FLASH.HEX", FLASHDISK, "FLASH.HEX"

! -- copy "RUN_V07.BIN" from SD-card (folder TO_RF) to FlashDisk (root folder):
copyFile SDCARD, "TO_RF/RUN_V07.BIN", FLASHDISK, "RUN_V07.BIN"

Compile this into the RUN_V07.BIN file on the SD card’s root folder.

3. Copying the Data

Insert the SD card into the roloFlash and execute the process once using any target.

4. Execution without SD card

Remove the SD card and now test the procedure without the SD card.

Returning to Normal Operation with SD card

Priority of RUN_V07.BIN on the Flash Disk

A RUN_V07.BIN located on the Flash disk is executed in preference to a RUN_V07.BIN on the SD card.

How can I run a RUN_V07.BIN from the SD card again?

There are two options:

Appendix: Procedure copyFile

procedure copyFile fsSrc, filenameSrc, fsDst, filenameDst
  sys_setCpuClock 120000000
  dataSize = fs_fileSize(fsSrc, filenameSrc)
  fs_create fsDst, filenameDst, dataSize
  src = fs_open(fsSrc, filenameSrc)
  dst = fs_open(fsDst, filenameDst)
  blockSize = 512
  filePos = 0
  retval = 1
  do while dataSize > 0
    mySize = blockSize
    if mySize > dataSize
      mySize = dataSize
    endif
    a = fs_read(src, filePos, mySize)
    fs_write dst, filePos, a
    filePos = filePos + mySize
    dataSize = dataSize - mySize
  loop
  fs_close dst
  fs_close src
end