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

Other type of PCB for A9 mini camera. #11

Open
ljccitterio opened this issue Feb 5, 2024 · 2 comments
Open

Other type of PCB for A9 mini camera. #11

ljccitterio opened this issue Feb 5, 2024 · 2 comments

Comments

@ljccitterio
Copy link

ljccitterio commented Feb 5, 2024

I am trying to recover the bootloader of this mini camera.

Reading the BK7252 datasheet I found that it is possible to transfer data through its peripheral or SDIO controller. The BK7252 SDIO (secure digital input/output) controller supports master and slave modes. It can operate at clock speeds up to 50 MHz, which is suitable for high-speed data transfers.

The SDIO controller has two modes of operation:

  Master Mode: In this mode, the BK7252 SDIO controller acts as a master device, initiating data transfers and communicating with external devices such as SD cards. In this mode, the BK7252 can read data from or write data to an external SD card.
  Slave Mode: In this mode, the BK7252 SDIO controller acts as a slave device and responds to commands from an external host. In this mode, the BK7252 can be used to communicate with external hosts, such as a computer or other microcontroller.

The SDIO controller supports four data widths: 1-bit, 4-bit, and 8-bit modes. 1-bit mode is the lowest speed mode, while 4-bit mode is the highest speed mode. 8-bit mode is not supported by the BK7252 SDIO controller.

The SDIO controller in the BK7252 has a dedicated DMA (Direct Memory Access) channel. This DMA channel can operate at high speeds without loading the main microcontroller (MCU). This ensures fast and efficient data transfers between the BK7252 SDIO controller and external devices or hosts.

Below is an example of how to configure the SDIO controller in master mode:

void sdio_master_init(void)
{
    uint32_t reg_val;

    /* Enable SDIO clock */
    reg_val = BL_RD_REG(GLB_BASE, GLB_CLK_CFG0);
    reg_val |= (1 << 16);
    BL_WR_REG(GLB_BASE, GLB_CLK_CFG0, reg_val);

    /* Configure SDIO as master */
    reg_val = BL_RD_REG(SDIO_BASE, SDIO_CTRL);
    reg_val &= ~(1 << 0);
    BL_WR_REG(SDIO_BASE, SDIO_CTRL, reg_val);

    /* Configure SDIO clock speed */
    reg_val = BL_RD_REG(SDIO_BASE, SDIO_CLK_CTRL);
    reg_val &= ~(0x7 << 0);
    reg_val |= (0x4 << 0); // 50 MHz
    BL_WR_REG(SDIO_BASE, SDIO_CLK_CTRL, reg_val);

    /* Enable SDIO clock */
    reg_val = BL_RD_REG(SDIO_BASE, SDIO_CLK_CTRL);
    reg_val |= (1 << 8);
    BL_WR_REG(SDIO_BASE, SDIO_CLK_CTRL, reg_val);
}

In this example, the SDIO controller is configured as a master device, with a clock speed of 50 MHz. The SDIO controller is then enabled to start processing data transfers.

Espero te ayude y me ayudes...

IMG_20240205_113647

IMG_20240205_113727

IMG_20240205_113547

@Apache02
Copy link

I was able to restore bootloader in SPI flash mode

This is the project i've made for this: https://github.com/Apache02/pico-beken

@ljccitterio
Copy link
Author

ljccitterio commented Dec 12, 2024

I was able to restore bootloader in SPI flash mode

This is the project i've made for this: https://github.com/Apache02/pico-beken

Hi...

I'm going to try that method with a NodeMCU ESP8266. I'll have to make some adaptations to LUA or MicroPython.

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

2 participants