Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issues for the Duo 256M #2

Open
GitJer opened this issue Jul 29, 2024 · 0 comments
Open

Some issues for the Duo 256M #2

GitJer opened this issue Jul 29, 2024 · 0 comments

Comments

@GitJer
Copy link

GitJer commented Jul 29, 2024

In the guide it says to download firmware.zip. In that file there is a pre-compiled version of 8051_up. But that one doesn't work. You have to compile it yourself using the SDK which can be found here. The code for 8051_up is located in duo-8051/tools/8051_up/ of the duo-8051 github (i.e. this repository).

The guide says to Copy 8051_up, mars_mcu_fw.bin, and blink.sh into /mnt/data, and grant execution and read permissions but you also need to copy the file '8051_boot_cfg.ini' which can be found in the file firmware.zip.

In the file 8051_up.c mentioned above, is the line #define MCU_FW_PATH "/lib/firmware/mars_mcu_fw.bin". This means that the 8051_up expects your executable to be located in the directory /lib/firmware/ instead of /mnt/data/. So, you can either create that directory and place your executable there, or change the line in 8051_up.c and recompile.

The base_project of this repository should toggle the blue led on the board when using blink.sh from firmware.zip. It doesn't for the Duo 256M. The problem is the GPIO numbering and memory address to be used in code. The solution was to add the line #define GPIO4_BASE 0x05021000 in the file cvi_gpio.h of the base_project. And in the file main.c the lines at case 0x6: and case 0x7 should be changed into:

                 case 0x6: /* gpio_high */
                        set_gpio_direction(GPIO4_BASE,2,GPIO_DIRECTION_OUT);
                        set_gpio_level(GPIO4_BASE,2,GPIO_LEVEL_HIGH);
                        mmio_write_32(RTC_INFO1, 0xff);
                        printf("LED_GPIO->HIGH\n");
                        break;

                case 0x7: /* gpio_low */
                        set_gpio_direction(GPIO4_BASE,2,GPIO_DIRECTION_OUT);
                        set_gpio_level(GPIO4_BASE,2,GPIO_LEVEL_LOW);
                        mmio_write_32(RTC_INFO1, 0xff);
                        printf("LED_GPIO->LOW\n");
                        break;

Note the use of GPIO4_BASE and pin number 2. Also note that the name 'GPIO4' is probably technically not correct, but it doesn't really matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant