{"action":"created","issue":{"url":"https://api.github.com/repos/blacksphere/blackmagic/issues/99","repository_url":"https://api.github.com/repos/blacksphere/blackmagic","labels_url":"https://api.github.com/repos/blacksphere/blackmagic/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/blacksphere/blackmagic/issues/99/comments","events_url":"https://api.github.com/repos/blacksphere/blackmagic/issues/99/events","html_url":"https://github.com/blacksphere/blackmagic/issues/99","id":103403001,"number":99,"title":"Data written to flash on LPC11C24 gets corrupted","user":{"login":"zyp","id":153099,"avatar_url":"https://avatars.githubusercontent.com/u/153099?v=3","gravatar_id":"","url":"https://api.github.com/users/zyp","html_url":"https://github.com/zyp","followers_url":"https://api.github.com/users/zyp/followers","following_url":"https://api.github.com/users/zyp/following{/other_user}","gists_url":"https://api.github.com/users/zyp/gists{/gist_id}","starred_url":"https://api.github.com/users/zyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyp/subscriptions","organizations_url":"https://api.github.com/users/zyp/orgs","repos_url":"https://api.github.com/users/zyp/repos","events_url":"https://api.github.com/users/zyp/events{/privacy}","received_events_url":"https://api.github.com/users/zyp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-27T01:43:28Z","updated_at":"2016-06-21T18:48:47Z","closed_at":null,"body":"I'm getting started with LPC11C24 here, and flash writes seems to get corrupted.\r\n\r\n```\r\n(gdb) load\r\nLoading section .vectors, size 0x130 lma 0x0\r\nLoading section .init_array, size 0x4 lma 0x130\r\nLoading section .text, size 0x1c0 lma 0x134\r\nLoading section .data, size 0x4 lma 0x2f4\r\nStart address 0x134, load size 760\r\nTransfer rate: 3 KB/sec, 190 bytes/write.\r\n(gdb) compare-sections \r\nSection .vectors, range 0x0 -- 0x130: MIS-MATCHED!\r\nSection .init_array, range 0x130 -- 0x134: MIS-MATCHED!\r\nSection .text, range 0x134 -- 0x2f4: MIS-MATCHED!\r\nSection .data, range 0x2f4 -- 0x2f8: matched.\r\nwarning: One or more sections of the remote executable does not match the loaded file\r\n(gdb) x/wx 0x130\r\n0x130 <_init_array_start>:\t0x42900093\r\n(gdb) detach\r\nDetached from remote process.\r\n(gdb) x/wx 0x130\r\n0x130 <_init_array_start>:\t0x00000139\r\n```\r\n\r\nI'd expect .vectors to mismatch, due to the signature generation, but not the other sections. Since .init_array contains an invalid address, the processor hardfaults during startup code.\r\n"},"comment":{"url":"https://api.github.com/repos/blacksphere/blackmagic/issues/comments/227535107","html_url":"https://github.com/blacksphere/blackmagic/issues/99#issuecomment-227535107","issue_url":"https://api.github.com/repos/blacksphere/blackmagic/issues/99","id":227535107,"user":{"login":"dlaw","id":606010,"avatar_url":"https://avatars.githubusercontent.com/u/606010?v=3","gravatar_id":"","url":"https://api.github.com/users/dlaw","html_url":"https://github.com/dlaw","followers_url":"https://api.github.com/users/dlaw/followers","following_url":"https://api.github.com/users/dlaw/following{/other_user}","gists_url":"https://api.github.com/users/dlaw/gists{/gist_id}","starred_url":"https://api.github.com/users/dlaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlaw/subscriptions","organizations_url":"https://api.github.com/users/dlaw/orgs","repos_url":"https://api.github.com/users/dlaw/repos","events_url":"https://api.github.com/users/dlaw/events{/privacy}","received_events_url":"https://api.github.com/users/dlaw/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T18:48:47Z","updated_at":"2016-06-21T18:48:47Z","body":"The first 512 bytes of the address space are mapped to boot ROM by default. Once you write the SYSMEMREMAP register (address 0x40048000) to have a value of 2, those 512 bytes are mapped to flash and all sections will match. The LPC bootloader automatically does this upon detecting valid user code, but the bootloader cannot run while you are holding the chip in reset with a debugger. See section 3.5.1 of the [manual](http://www.nxp.com/documents/user_manual/UM10398.pdf). In gdb, you can `set {int}0x40048000 = 2` to achieve the same result.\r\n\r\nIn summary, this is not a bug with the LPC refactoring."}}
{"actor":{"display_login":"dlaw"}}