hi!
i do not understand how this code (from target.c) works.
i'm working with a dsp568013.
each memory address holds 16 bits.
when i run "mdh someaddress count" with count over 16, openocd's
output does not match what i would expect. the first 16 words are
displayed in a line with address "someaddress", but the following
readings are displayed on a line labeled "someaddress+32", when i
would expect + 16 (since 16 mem locations where read).
my problem is with this part of the code, which i guess assumes that
mem locations are 8 bit instead of 16, or something else which i don't
understand.
from target.c:handle_md_output:
//------------------------------------------------------------------
//------------------------------------------------------------------
        for (unsigned i = 0; i < count; i++)
        {
                if (i % line_modulo == 0)
                {
                        output_len += snprintf(output + output_len,
                                        sizeof(output) - output_len,
                                        "0x%8.8x: ",
                                        (unsigned)(address + (i*size)));
//The previous line will make each line begin with address,
address+32, address+64, etc, since size=2 and line_modulo = 32/size.
                }

                uint32_t value = 0;
                const uint8_t *value_ptr = buffer + i * size;
                switch (size) {
                case 4: value = target_buffer_get_u32(target, value_ptr); break;
                case 2: value = target_buffer_get_u16(target, value_ptr); break;
                case 1: value = *value_ptr;
                }
                output_len += snprintf(output + output_len,
                                sizeof(output) - output_len,
                                value_fmt, value);

                if ((i % line_modulo == line_modulo - 1) || (i == count - 1))
                {
                        command_print(cmd_ctx, "%s", output);
                        output_len = 0;
                }
        }
//------------------------------------------------------------------
//------------------------------------------------------------------

do i have to configure something to tell openocd that i'm using 16bit memory?

another question: i haven't been able to find a way to make load_image
and verify_image work with my target, any clues?
to implement "resume" for example, i added .resume=my_resume_function
to my target. is there something similar for load_image?

thanks!

--
Rodrigo.
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to