Skip to content

Commit 7461f24

Browse files
committed
Added debug prints for configuration and read ID commands;
Removed debug from read function due to high frequrency of calls
1 parent 821daeb commit 7461f24

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

firmware/nand_programmer.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ static int _np_cmd_nand_read_id(np_prog_t *prog)
249249
if (np_comm_cb)
250250
np_comm_cb->send((uint8_t *)&resp, resp_len);
251251

252+
DEBUG_PRINT("Chip ID: 0x%x 0x%x 0x%x 0x%x\r\n",
253+
resp.nand_id.maker_id, resp.nand_id.device_id, resp.nand_id.third_id,
254+
resp.nand_id.fourth_id);
255+
252256
return 0;
253257
}
254258

@@ -699,8 +703,6 @@ static int np_nand_read(uint32_t addr, np_page_t *page,
699703
{
700704
uint32_t status;
701705

702-
DEBUG_PRINT("NAND read at 0x%lx\r\n", addr);
703-
704706
status = nand_read_page(page->buf, page->page, chip_info->page_size);
705707
switch (status)
706708
{
@@ -859,6 +861,16 @@ static int np_cmd_nand_conf(np_prog_t *prog)
859861
prog->chip_info.ar_setup_time = conf_cmd->ar_setup_time;
860862
prog->chip_is_conf = 1;
861863

864+
DEBUG_PRINT("Page size: %lu\r\n", prog->chip_info.page_size);
865+
DEBUG_PRINT("Block size: %lu\r\n", prog->chip_info.block_size);
866+
DEBUG_PRINT("Size: %lu\r\n", prog->chip_info.size);
867+
DEBUG_PRINT("Setup time: %d\r\n", prog->chip_info.setup_time);
868+
DEBUG_PRINT("Wait setup time: %d\r\n", prog->chip_info.wait_setup_time);
869+
DEBUG_PRINT("Hold setup time: %d\r\n", prog->chip_info.hold_setup_time);
870+
DEBUG_PRINT("HiZ setup time: %d\r\n", prog->chip_info.hi_z_setup_time);
871+
DEBUG_PRINT("CLR setip time: %d\r\n", prog->chip_info.clr_setup_time);
872+
DEBUG_PRINT("AR setip time: %d\r\n", prog->chip_info.ar_setup_time);
873+
862874
nand_init(&prog->chip_info);
863875

864876
nand_bad_block_table_init();

0 commit comments

Comments
 (0)