Skip to content
Bogdan Bogush edited this page Feb 27, 2021 · 24 revisions

Welcome to the nand_programmer wiki!

Table of contents

  1. PCB
  2. Board components
  3. Soldering
  4. Burn firmware
  5. Add new parallel NAND chip
  6. Add new SPI chip

PCB

  • Download Gerber files from Google Drive release/nando-x.x.x/PCB/gerber/
  • Register on one of the PCB manufacture websites, for example, https://jlcpcb.com/
  • Create order and load gerber files.
  • Configure PCB parameters as in following example:

The received PCBs:

Board components

The release directory on Google Drive contains a BOM.html (bill of materials) file. The file has a list of required parts for the device. BOM.html provides https://www.farnell.com/ references so you can find parts by ID and order on this website or find analog on local store.

The device is based on STM32F103VCT6 in LQFP100 package with 256KB flash and 48KB SRAM. The other MCUs are not supported because firmware HAL supports only current family. In some cases it is not theoretically possible to port to another MCU due to flash memory size (<256 KB) or missing FSMC as in STM32F103Vx.

The crystal is in HC49-SD package, 8MHz and 18pF load capacitance. If clystal with the same load capacitance is missing the other one can be taken. The values of load capacitors should be fixed as follows:
Cl1 = Cl2 = 2 * (Cl - Cs) = 2 * (18pF - 3pF) = 30pF
Cl1 = Cl2 = 2 * (Cl - Cs) = 2 * (16pF - 3pF) = 26pF.
where Cl1,Cl2 - load capacitors value for crystal; Cl - load capacitance from datasheet; Cs - stray capacitance of the PCB, approximate value.
Resistors, capacitors, LEDs are in the 0805 package. Pinheaders with 2.54mm step.
Parts for adapters are not included in the BOM file but it is just a few pinheaders and TSOP-48 socket. TSOP-48 socket can be bought on https://www.ebay.com. Another option is to order a TSOP-48 adapter for TL866.

Soldering

The board can be soldered using regular soldering iron. The only requirement is to clean flux (even if it is "no-clean") by chemicals such as "kontakt u" or ultrasonic bath. Otherwise there will be high stray capacitance and the device will not work as expected. The schematic is available on Google Drive release directory.

Burn firmware

The STM32 MCU firmware can be burned using ST-Link or USB-UART adapter. Programming via USB is not supported on STM32F103.

ST-Link (SWD)

The device firmware is burned using ST-Link V2.

ST-Link is connected to the board's SWD pins as shown below. Brand-new MCU may require to be powered on with connected BOOT0 pins and sometimes additionally with RST pins (available in new PCB). After programming BOOT0 and RST pins must be unconnected.

ST-Link Ubuntu software

  • sudo apt-get install libusb-1.0-0-dev
  • git clone https://github.com/texane/stlink.git
  • cd stlink/
  • mkdir -p build && cd build
  • cmake -DCMAKE_BUILD_TYPE=Release ..
  • sudo make install
  • sudo cp ../etc/udev/rules.d/* /etc/udev/rules.d/
  • sudo udevadm control --reload-rules
  • sudo udevadm trigger
  • Connect ST-Link to board.
  • Download firmware from Google Driver release directory.
  • st-flash write nando_fw.bin 0x8000000

ST-Link Ubuntu/Windows/Mac STM32CubeProgrammer software

  • Download and install STM32CubeProgrammer from https://www.st.com or Google Driver tools directory.
  • Download firmware from Google Driver release directory.
  • Write firmware using STM32CubeProgrammer programmer.

USB-UART adapter

USB-UART adapter is connected to the board's UART pins as shown below. The board needs to be powered on with connected BOOT0 pins and sometimes additionally with RST pins (available in new PCB). After programming BOOT0 and RST pins must be unconnected.

USB-UART adapter Ubuntu/Windows/Mac STM32CubeProgrammer software

  • Download and install STM32CubeProgrammer from https://www.st.com or Google Driver tools directory.
  • Download firmware from Google Driver release directory.
  • Write firmware using STM32CubeProgrammer programmer. On Linux permission for /dev/ttyUSBx must be granted (sudo chmod 777 /dev/ttyUSB0).

Add new parallel NAND chip

Open Settings - Parallel chip database and add chip parameters from datasheet.
  • Name - name of chip.
  • Page Size - page size in bytes without spare area (hexadecimal).
  • Block Size - block size in bytes without spare area (hexadecimal).
  • Total Size - total size in bytes without spare area (hexadecimal).
  • Spare Size - spare size in bytes (hexadecimal).
  • BB mark off. - the offset of byte in the spare area which contains bad block mark. The block is considered as bad if the byte contains non 0xFF value. The offset starts from 0.
  • tCS - Chip Enable (CE) setup time (ns).
  • tCLS - Command Latch Enable (CLE) setup time (ns).
  • tALS - Address Latch Enable (ALE) setup time (ns).
  • tCLR - Command Latch Enable (CLE) to Read Enable (RE) delay (ns).
  • tAR - Address Latch Enable (ALE) to Read Enable (RE) delay (ns).
  • tWP - Write Enable (WE) pulse width (ns).
  • tRP - Read Enable (RE) pulse width (ns).
  • tDS - Data setup time (ns).
  • tCH - Chip Enable (CE) hold time (ns).
  • tALH - Address Latch Enable (ALE) hold time (ns).
  • tWC - Write cycle time (ns).
  • tRC - Read cycle time (ns).
  • tREA - (RE) access time (ns).
  • Row cycles - number of clock cycles required to program row address.
  • Col. cycles - number of clock cycles required to program column address.
  • Read 1 com. - command to read page 1st clock cycle (hexadecimal).
  • Read 2 com. - command to read page 2nd clock cycle (hexadecimal). Optional (-).
  • Read spr. com. - command to read spare area (hexadecimal). Optional (-).
  • Read ID com. - command to read chip ID (hexadecimal).
  • Write 1 com. - command to program page 1st cycle (hexadecimal).
  • Write 2 com. - command to program page 2nd cycle (hexadecimal). Optional (-).
  • Erase 1 com. - command to erase block 1st cycle (hexadecimal).
  • Erase 2 com. - command to erase block 2nd cycle (hexadecimal). Optional (-).
  • Status com. - status command (hexadecimal).
  • ID1 - 1st chip ID - manufacturer (hexadecimal).
  • ID2 - 2nd chip ID - device ID (hexadecimal). Optional (-).
  • ID3 - 3rd chip ID (hexadecimal). Optional (-).
  • ID4 - 4th chip ID (hexadecimal). Optional (-).
  • ID5 - 5th chip ID (hexadecimal). Optional (-).

Example Samsung K9F1G08U0E:










Add new SPI chip

Open Settings - SPI chip database and add chip parameters from datasheet.
  • Name - name of chip.
  • Page Size - page size in bytes (hexadecimal).
  • Block Size - block size in bytes (hexadecimal).
  • Total Size - total size in bytes (hexadecimal).
  • Page off. - page address offset in whole address. The whole address consists of page address and byte address.
  • Read com. - command to read page (hexadecimal).
  • Read ID com. - command to chip ID (hexadecimal).
  • Write com. - command to write page (hexadecimal).
  • Write en. com. - command to enable page write (hexadecimal). Optional (-).
  • Erase com. - command to erase block (hexadecimal).
  • Status com. - command to read status (hexadecimal).
  • Busy bit - bit number of busy bit in status register (starts from 0).
  • Busy bit state - state of busy bit in status register when chip is in busy state (0/1).
  • Freq. (kHz) - maximum clock frequency for all commands (kHz).
  • ID1 - 1st chip ID - manufacturer (hexadecimal).
  • ID2 - 2nd chip ID - device ID (hexadecimal). Optional (-).
  • ID3 - 3rd chip ID (hexadecimal). Optional (-).
  • ID4 - 4th chip ID (hexadecimal). Optional (-).
  • ID5 - 5th chip ID (hexadecimal). Optional (-).

Example Samsung AT25SF041:







Clone this wiki locally