{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/a850077f161719aed82500c30f1224ba?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"a850077f161719aed82500c30f1224ba","url":"https://api.github.com/users/bikeNomad","login":"bikeNomad","id":99482},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-11-03T03:19:30Z","comments":6,"closed_at":null,"url":"https://api.github.com/repos/texane/stlink/issues/12","body":"I'm seeing the same flash write problems described earlier.\r\n\r\nI can debug in SRAM fine.\r\n\r\nI updated to \"master 56c4ba7 [merge] patches from uwe\".\r\nRe-built library, gdbserver, and flash tool (after fixing code in flash tool).\r\nRan the gdbserver as:\r\n\r\n```\r\nned@linux-asus:~/src/stlink$ gdbserver/st-util usb /dev/stm32l_stlink2 \r\n\r\n```\r\n\r\nThen ran arm-none-eabi-gdb on the blink_flash example:\r\n\r\n```\r\nned@linux-asus:~/src/stlink/example/blink_flash$ arm-none-eabi-gdb blink.elf\r\nGNU gdb (Sourcery G++ Lite 2010.09-51) 7.2.50.20100908-cvs\r\nThis GDB was configured as \"--host=i686-pc-linux-gnu --target=arm-none-eabi\".\r\nReading symbols from /home/ned/src/stlink/example/blink_flash/blink.elf...(no debugging symbols found)...done.\r\n(gdb) tar ext :4242\r\nRemote debugging using :4242\r\n0x0800422c in ?? ()\r\n(gdb) load\r\nLoading section .isr_vector, size 0x10c lma 0x8000000\r\nLoading section .text, size 0x9c lma 0x800010c\r\n```\r\n\r\nAnd then it never came back to me.\r\n\r\nThe output from the gdbserver debug was this:\r\n\r\n```\r\nstlink current mode: mass\r\n*** looking up stlink version\r\nst vid         = 0x0483 (expect 0x0483)\r\nstlink pid     = 0x3748\r\nstlink version = 0x2\r\njtag version   = 0xe\r\nswim version   = 0x0\r\n    notice: the firmware doesn't support a swim interface\r\nstlink current mode: mass\r\nstlink current mode: mass\r\n\r\n*** stlink_enter_swd_mode ***\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 11 64 00 20\r\n\r\n\r\n*** stlink_core_id ***\r\ndata_len = 4 0x4\r\n 77 14 a0 2b\r\n\r\ncore_id = 0x2ba01477\r\nFixing wrong chip_id for STM32F4 Rev A errata\r\nChip ID is 00000413, Core ID is  2ba01477.\r\nDevice connected: F4 device\r\nDevice parameters: SRAM: 0x20000 bytes, Flash: up to 0x100000 bytes in pages of 0x20000 bytes\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 22 00 2d 00\r\n\r\nFlash size is 34 KiB.\r\n\r\n*** stlink_force_debug_mode ***\r\n\r\n*** stlink_reset ***\r\n\r\n*** stlink_write_mem32 ***\r\nKARL - should read back as 0x03, not 60 02 00 00\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 61 02 00 00\r\n\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 01 00 00 00\r\n\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\nListening at *:4242...\r\nGDB connected.\r\n\r\n*** stlink_read_all_regs ***\r\ndata_len = 84 0x54\r\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 0c 00 20 ff ff ff ff 2c 42 00 08 00 00 00 01 80 0c 00 20 00 00 00 00 00 00 00 00 00 00 00 00\r\n\r\nxpsr       = 0x01000000\r\nmain_sp    = 0x20000c80\r\nprocess_sp = 0x00000000\r\nrw         = 0x00000000\r\nrw2        = 0x00000000\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 04 48 01 68\r\n\r\n\r\n*** stlink_reset ***\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 00 00 00 00\r\n\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 00 00 00 00\r\n\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 00 00 00 00\r\n\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 00 00 00 00\r\n\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_write_mem8 ***\r\n\r\n*** stlink_write_reg\r\ndata_len = 2 0x2\r\n 80 00\r\n\r\n\r\n*** stlink_write_reg\r\ndata_len = 2 0x2\r\n 80 00\r\n\r\n\r\n*** stlink_write_reg\r\ndata_len = 2 0x2\r\n 80 00\r\n\r\n\r\n*** stlink_write_reg\r\ndata_len = 2 0x2\r\n 80 00\r\n\r\n\r\n*** stlink_write_reg\r\ndata_len = 2 0x2\r\n 80 00\r\n\r\n\r\n*** stlink_read_mem32 ***\r\ndata_len = 4 0x4\r\n 00 00 00 00\r\n\r\n\r\n*** stlink_write_mem32 ***\r\n\r\n*** stlink_run ***\r\n\r\n*** stlink_status ***\r\ndata_len = 4 0x4\r\n 80 00 00 00\r\n\r\n  core status: running\r\n\r\n*** stlink_status ***\r\ndata_len = 4 0x4\r\n 80 00 00 00\r\n\r\n  core status: running\r\n```\r\n\r\nThe stlink_status messages repeated ad infinitum until I killed the server.","html_url":"https://github.com/texane/stlink/issues/12","number":12,"title":"STM32F4 writing to flash does not work","id":2000476,"created_at":"2011-10-20T01:30:29Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/2523d7853541a196c4fa2e90e432f42b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2523d7853541a196c4fa2e90e432f42b","url":"https://api.github.com/users/lbuchy","login":"lbuchy","id":997542},"updated_at":"2011-11-03T03:19:30Z","url":"https://api.github.com/repos/texane/stlink/issues/comments/2612855","body":"I've also managed to write and read back ~16kB of data.  Have not yet been able to actually run a program (Such as the one in examples/blink.  ","id":2612855,"created_at":"2011-11-03T03:19:30Z"}}