Skip to content

Commit fb3363a

Browse files
committed
2 parents 45cd0a2 + 7962d14 commit fb3363a

13 files changed

+37
-21
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,6 @@ Linux based OS
117117
- Press "+" button and fill out parameters from datasheet.
118118

119119
<img src="img/chip_db_settings.jpeg">
120+
121+
## WiKi
122+
Check [WiKi](https://github.com/bbogush/nand_programmer/wiki) page for more information.

firmware/programmer/fsmc_nand.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ static void nand_print_fsmc_info()
138138
DEBUG_PRINT("Status command: %d\r\n", fsmc_conf.status_cmd);
139139
}
140140

141+
static void nand_reset()
142+
{
143+
*(__IO uint8_t *)(Bank_NAND_ADDR | CMD_AREA) = fsmc_conf.reset_cmd;
144+
}
145+
141146
static int nand_init(void *conf, uint32_t conf_size)
142147
{
143148
if (conf_size < sizeof(fsmc_conf_t))
@@ -148,6 +153,7 @@ static int nand_init(void *conf, uint32_t conf_size)
148153
nand_gpio_init();
149154
nand_fsmc_init(fsmc_conf);
150155
nand_print_fsmc_info();
156+
nand_reset();
151157

152158
return 0;
153159
}

firmware/programmer/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
#define SW_VERSION_MAJOR 3
1010
#define SW_VERSION_MINOR 4
11-
#define SW_VERSION_BUILD 0
11+
#define SW_VERSION_BUILD 1
1212

1313
#endif

qt/cmd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ typedef struct __attribute__((__packed__))
6464
{
6565
Cmd cmd;
6666
uint8_t len;
67-
uint8_t data[];
6867
} WriteDataCmd;
6968

7069
typedef struct __attribute__((__packed__))
@@ -119,7 +118,6 @@ typedef struct __attribute__((__packed__))
119118
{
120119
uint8_t code;
121120
uint8_t info;
122-
uint8_t data[];
123121
} RespHeader;
124122

125123
typedef struct __attribute__((__packed__))

qt/main_window.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void MainWindow::slotProgConnectCompleted(int status)
219219
disconnect(prog, SIGNAL(connectCompleted(int)), this,
220220
SLOT(slotProgConnectCompleted(int)));
221221

222-
if (status)
222+
if (status < 0)
223223
return;
224224

225225
qInfo() << "Connected to programmer";
@@ -253,7 +253,7 @@ void MainWindow::slotProgReadDeviceIdCompleted(int status)
253253
disconnect(prog, SIGNAL(readChipIdCompleted(int)), this,
254254
SLOT(slotProgReadDeviceIdCompleted(int)));
255255

256-
if (status)
256+
if (status < 0)
257257
return;
258258

259259
idStr = tr("0x%1 0x%2 0x%3 0x%4 0x%5")
@@ -325,7 +325,7 @@ void MainWindow::slotProgErase()
325325
prog->eraseChip(START_ADDRESS, eraseSize);
326326
}
327327

328-
void MainWindow::slotProgReadCompleted(int status)
328+
void MainWindow::slotProgReadCompleted(int readBytes)
329329
{
330330
disconnect(prog, SIGNAL(readChipProgress(unsigned int)), this,
331331
SLOT(slotProgReadProgress(unsigned int)));
@@ -334,15 +334,21 @@ void MainWindow::slotProgReadCompleted(int status)
334334

335335
setProgress(100);
336336

337-
if (status)
337+
if (readBytes < 0)
338338
{
339339
buffer.clear();
340340
return;
341341
}
342342

343+
if (readBytes > buffer.size())
344+
{
345+
qCritical() << "Read operation returned more than requested: " <<
346+
readBytes << ">" << buffer.size();
347+
return;
348+
}
349+
343350
qInfo() << "Data has been successfully read";
344-
bufferTableModel.setBuffer(buffer.data(),
345-
static_cast<uint32_t>(buffer.size()));
351+
bufferTableModel.setBuffer(buffer.data(), readBytes);
346352
}
347353

348354
void MainWindow::slotProgReadProgress(unsigned int progress)
@@ -555,7 +561,7 @@ void MainWindow::slotProgDetectChipReadChipIdCompleted(int status)
555561
disconnect(prog, SIGNAL(readChipIdCompleted(int)), this,
556562
SLOT(slotProgDetectChipReadChipIdCompleted(int)));
557563

558-
if (status)
564+
if (status < 0)
559565
return;
560566

561567
idStr = tr("0x%1 0x%2 0x%3 0x%4 0x%5")
@@ -593,7 +599,7 @@ void MainWindow::slotProgDetectChipConfCompleted(int status)
593599
disconnect(prog, SIGNAL(confChipCompleted(int)), this,
594600
SLOT(slotProgDetectChipConfCompleted(int)));
595601

596-
if (status)
602+
if (status < 0)
597603
return;
598604

599605
QTimer::singleShot(50, this, &MainWindow::detectChipReadChipIdDelayed);

qt/main_window.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MainWindow : public QMainWindow
4949
private slots:
5050
void slotProgConnectCompleted(int status);
5151
void slotProgReadDeviceIdCompleted(int status);
52-
void slotProgReadCompleted(int status);
52+
void slotProgReadCompleted(int readBytes);
5353
void slotProgReadProgress(unsigned int progress);
5454
void slotProgWriteCompleted(int status);
5555
void slotProgWriteProgress(unsigned int progress);

qt/main_window.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</property>
7070
<property name="minimumSize">
7171
<size>
72-
<width>190</width>
72+
<width>220</width>
7373
<height>0</height>
7474
</size>
7575
</property>
@@ -258,7 +258,7 @@
258258
<x>0</x>
259259
<y>0</y>
260260
<width>630</width>
261-
<height>21</height>
261+
<height>22</height>
262262
</rect>
263263
</property>
264264
<widget class="QMenu" name="menuDevice">

qt/nando_parallel_chip_db.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ HY27US08121B, 512, 16384, 67108864, 16, 5, 0, 0, 0, 10, 10, 25, 25, 20, 10, 10,
99
TC58NVG2S3E, 2048, 131072, 536870912, 64, 0, 20, 12, 12, 10, 10, 12, 12, 12, 5, 5, 5, 25, 25, 20, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 152, 220, 144, 21, 118
1010
TC58NVG1S3E, 2048, 131072, 268435456, 64, 0, 20, 12, 12, 10, 10, 12, 12, 12, 5, 5, 5, 25, 25, 20, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 152, 218, 144, 21, 118
1111
F59L2G81A, 2048, 131072, 268435456, 64, 0, 20, 12, 5, 10, 10, 12, 12, 12, 5, 5, 5, 25, 25, 20, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 200, 218, 144, 149, 68
12-
MT29F4G08ABAD, 2048, 131072, 536870912, 64, 0, 15, 10, 10, 10, 10, 10, 10, 7, 5, 5, 5, 20, 20, 16, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 44, 220, 144, 149, 86
12+
MT29F2G08ABAEA, 2048, 131072, 268435456, 64, 0, 15, 10, 10, 10, 10, 10, 10, 7, 5, 5, 5, 20, 20, 16, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 44, 218, 144, 149, -
13+
MT29F4G08ABAD, 2048, 131072, 536870912, 64, 0, 15, 10, 10, 10, 10, 10, 10, 7, 5, 5, 5, 20, 20, 16, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 44, 220, 144, 149, -
1314
MX30LF2G18AC, 2048, 131072, 268435456, 64, 0, 15, 10, 10, 10, 10, 10, 10, 7, 5, 5, 5, 20, 20, 16, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 194, 218, 144, 149, 6
1415
S43ML01G1, 2048, 131072, 134217728, 64, 0, 20, 10, 10, 10, 10, 12, 12, 10, 5, 5, 5, 25, 25, 20, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 1, 241, 0, 29, -
1516
S43ML02G1, 2048, 131072, 268435456, 64, 0, 20, 10, 10, 10, 10, 12, 12, 10, 5, 5, 5, 25, 25, 20, 3, 2, 0, 48, -, 144, 255, 128, 16, 96, 208, 112, 1, 218, 144, 149, 68

qt/parallel_chip_db_dialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</property>
2222
<property name="maximumSize">
2323
<size>
24-
<width>1470</width>
24+
<width>16777215</width>
2525
<height>16777215</height>
2626
</size>
2727
</property>

qt/qt.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ QMAKE_CXXFLAGS += -std=c++11 -Wextra -Werror
8282
mingw:QMAKE_CXXFLAGS += -mno-ms-bitfields
8383

8484
unix: {
85-
LIBS += -lboost_system -lboost_thread
85+
# use static linking for boost to avoid version dependency issues
86+
LIBS += -Wl,-Bstatic -lboost_system -lboost_thread -Wl,-Bdynamic
8687
}
8788

8889
win32: {

0 commit comments

Comments
 (0)