make_memory_map should receive flash_size as uint32_t.
authorPeter Zotov <whitequark@whitequark.org>
Thu, 19 May 2011 14:38:02 +0000 (18:38 +0400)
committerPeter Zotov <whitequark@whitequark.org>
Thu, 19 May 2011 14:41:00 +0000 (18:41 +0400)
src/gdb-server.c

index 6b57e78dac40c67a3d60e2060b1ac7e5833bf6d3..d44f20f18cb6cab1b7b77543ea6dda357a24781f 100644 (file)
@@ -46,7 +46,7 @@ struct chip_params {
 };
 
 int serve(struct stlink* sl, int port);
-char* make_memory_map(const struct chip_params *params, uint16_t flash_size);
+char* make_memory_map(const struct chip_params *params, uint32_t flash_size);
 
 int main(int argc, char** argv) {
        if(argc != 3) {
@@ -87,7 +87,7 @@ int main(int argc, char** argv) {
        printf("Device parameters: SRAM: 0x%x bytes, Flash: up to 0x%x bytes in pages of 0x%x bytes\n",
                params->sram_size, params->max_flash_size, params->flash_pagesize);
 
-       uint16_t flash_size;
+       uint32_t flash_size;
 
        stlink_read_mem32(sl, 0x1FFFF7E0, 4);
        flash_size = sl->q_buf[0] | (sl->q_buf[1] << 8);
@@ -121,7 +121,7 @@ static const char* const memory_map_template =
   "  <memory type=\"rom\" start=\"0x1ffff800\" length=\"0x8\"/>"        // option byte area
   "</memory-map>";
 
-char* make_memory_map(const struct chip_params *params, uint16_t flash_size) {
+char* make_memory_map(const struct chip_params *params, uint32_t flash_size) {
        /* This will be freed in serve() */
        char* map = malloc(4096);
        map[0] = '\0';