导航

    Freqchip开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    1. 主页
    2. uplooking
    3. 帖子
    U
    • 继续与 uplooking 聊天
    • 开始与 uplooking 的新会话
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 主题
    • 帖子
    • 最佳
    • 群组

    uplooking 发布的帖子

    • RE: 寻求低功耗例程

      代码如下:

      __attribute__((section("ram_code"))) void pmu_gpio_isr_ram(void)
      {
          uint32_t gpio_value = ool_read32(PMU_REG_GPIOA_V);
      
          // PB5
          if (gpio_value & GPIO_PB5)
          {
          
              co_printf("%s  gpio_value: %x\r\n", __func__, gpio_value);
          }
          else
          {
              button_toggle_detected(gpio_value);
          }
          
          // co_printf(" %s gpio_value: %x\r\n", __func__, gpio_value);
      
          ool_write32(PMU_REG_PORTA_LAST, gpio_value);
      }
      
      
      
      void user_key_init(void)
      {
          // 设置上拉 PD7 按键
          pmu_set_pin_pull(KEY_GPIO_PORT, (1 << KEY_GPIO_BIT), true);
      
          // PB5 外部中断引脚
          pmu_set_pin_pull(GPIO_PORT_B, (1 << GPIO_BIT_5), true);
      
          // PD7 PB5
          pmu_port_wakeup_func_set(KEY_GPIO | GPIO_PB5);
      
          button_init(KEY_GPIO);
      }
      
      

      问题如下:现在有PB5和PD7都设置中断唤醒,在中断处理函数pmu_gpio_isr_ram中如何区分是PD7引脚的中断,还是PB5的中断呢?

      发布在 FR801xH
      U
      uplooking
    • RE: 寻求低功耗例程

      中断处理函数 PD7和PB5

      __attribute__((section("ram_code"))) void pmu_gpio_isr_ram(void)
      {
          uint32_t gpio_value = ool_read32(PMU_REG_GPIOA_V);
      
          button_toggle_detected(gpio_value);
      
          co_printf(" %s gpio_value: %x\r\n", __func__, gpio_value);
      
          ool_write32(PMU_REG_PORTA_LAST, gpio_value);
      }
      

      按下Key(PD7),运行结果如下:

      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 5080a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 4000a03c
      pmu_gpio_isr_ram gpio_value: c000a03c
      pmu_gpio_isr_ram gpio_value: 4000a03c
      pmu_gpio_isr_ram gpio_value: c000a03c
      pmu_gpio_isr_ram gpio_value: 5000a03c
      pmu_gpio_isr_ram gpio_value: c000a03c
      pmu_gpio_isr_ram gpio_value: 4000a03c
      pmu_gpio_isr_ram gpio_value: c000a03c
      pmu_gpio_isr_ram gpio_value: 4000a03c
      pmu_gpio_isr_ram gpio_value: d080a03c
      pmu_gpio_isr_ram gpio_value: 4000a03c
      pmu_gpio_isr_ram gpio_value: c000a03c

      
      请问一下,为啥同一个按键按下和抬起输出的值不一样?
      发布在 FR801xH
      U
      uplooking
    • flash_protect_enable问题
      /*********************************************************************
       * @fn      flash_protect_enable
       *
       * @brief   protect flash chip from erase and write.
       *
       * @param   wr_mode     - 0: write.enable with command 0x50
       *                        1: write enable with command 0x06
       *
       * @return  None.
       */
      __attribute__((section("ram_code"))) void flash_protect_enable(uint8_t wr_mode);
      
      /*********************************************************************
       * @fn      flash_protect_enable1
       *
       * @brief   protect flash chip from erase and write.
       *
       * @param   wr_mode     - 0: write.enable with command 0x50
       *                        1: write enable with command 0x06
       *          mask        protect bits mask, refer to flash spec
       *
       * @return  None.
       */
      __attribute__((section("ram_code"))) void flash_protect_enable1(uint8_t wr_mode,uint8_t mask);
      
      /*********************************************************************
       * @fn      flash_protect_disable
       *
       * @brief   remove protection flash chip from erase and write.
       *
       * @param   wr_mode     - 0: write.enable with command 0x50
       *                        1: write enable with command 0x06
       *
       * @return  None.
       */
      __attribute__((section("ram_code"))) void flash_protect_disable(uint8_t wr_mode);
      
      
      
      

      flash_protect_enable和flash_protect_enable1有什么区别吗?

      发布在 FR801xH
      U
      uplooking
    • RE: co_delay_100us(10);延时函数在哪个头文件里

      sys_utils.h

      发布在 FR800x
      U
      uplooking
    • RE: 寻求低功耗例程
      __attribute__((section("ram_code"))) void pmu_gpio_isr_ram(void)
      {
          uint32_t gpio_value = ool_read32(PMU_REG_GPIOA_V);
      
          co_printf("gpio_value: %X\r\n", gpio_value);
      
          ool_write32(PMU_REG_PORTA_LAST, gpio_value);
      }
      

      这个PMU中GPIO中断处理函数,可以区分哪一个GPIO吗? 比如我设置PA0,PA1都可以唤醒深度睡眠,如何区分是哪一个IO口触发的中断?

      发布在 FR801xH
      U
      uplooking
    • RE: 寻求低功耗例程

      @ZR
      设置下降沿触发中断唤醒有提供API吗?

      发布在 FR801xH
      U
      uplooking
    • RE: 寻求低功耗例程

      设置按键唤醒,可以设置为下降沿产生中断吗?

          pmu_set_pin_pull(GPIO_PORT_C, (1 << GPIO_BIT_5), true);
          pmu_port_wakeup_func_set(GPIO_PC5);
      

      上述代码是按键按下和抬起都会产生中断。

      发布在 FR801xH
      U
      uplooking
    • RE: 关于FR801xH修改Mac地址失败的问题

      Mac地址可以烧录到Flash里面吗?MCU后面每次重启的时候是Flash中的Mac地址。

      发布在 FR801xH
      U
      uplooking
    • 关于FR801xH修改Mac地址失败的问题
      
      /*********************************************************************
       * @fn      user_custom_parameters
       *
       * @brief   initialize several parameters, this function will be called 
       *          at the beginning of the program. 
       *
       * @param   None. 
       *       
       *
       * @return  None.
       */
      void user_custom_parameters(void)
      {
          struct chip_unique_id_t id_data;
      
          efuse_get_chip_unique_id(&id_data);
      
          __jump_table.addr.addr[0] = 0x55;
          __jump_table.addr.addr[1] = 0xEE;
          __jump_table.addr.addr[2] = 0x88;
          __jump_table.addr.addr[3] = 0x17;
          __jump_table.addr.addr[4] = 0x9C;
          __jump_table.addr.addr[5] = 0x00;
          
          id_data.unique_id[5] |= 0xc0; // random addr->static addr type:the top two bit must be 1.
          // memcpy(__jump_table.addr.addr,id_data.unique_id,6); 
          __jump_table.system_clk = SYSTEM_SYS_CLK_48M;
          jump_table_set_static_keys_store_offset(JUMP_TABLE_STATIC_KEY_OFFSET);
      
          retry_handshake();
      }
      
      

      你好,我在上述代码片段中修改了Mac地址,但是通过gap_address_get获取之后,还是原来的mac。请问下修改mac地址的方法是怎样的呢?

      发布在 FR801xH
      U
      uplooking
    • 是否支持微秒为单位的延时?

      co_delay_10us默认最小单位是10us,请问一下原厂有提供co_delay_us微秒级别的延时吗?如果没有,软件模拟的也可以,是否可以提供参考?

      发布在 FR801xH
      U
      uplooking
    • RE: Keil v5.38 how to setup it to compile the ble_simple_peripheral ?

      使用gcc编译哦

      发布在 FR801xH
      U
      uplooking
    • RE: 认证问题

      可以直接编译一个,使用AT指令。

      发布在 FR801xH
      U
      uplooking
    • 关于SPI的问题
      1. 富芮坤的蓝牙MCU作为主机,如何设置•CPOL=0:空闲状态时,SCK为低电平•CPHA=0:SCK第一个边沿移入数据,第二个边沿移出数据。
      2. 为什么使用ssp_send_data(&TxData, 1)发送一个字节之后,随后发送一个0.

      0_1750663004283_3.png

      发布在 FR801xH
      U
      uplooking
    • RE: 串口烧录卡在这里不动了

      @zhangyonghui 换一个工具吧

      发布在 FR801xH
      U
      uplooking