Merge branch 'docs/update_cn_trans_for_ulp-risc-v' into 'master'

docs: Update CN translation for ulp-risc-v.rst

Closes DOC-7014

See merge request espressif/esp-idf!28738
This commit is contained in:
Shang Zhou 2024-02-06 12:19:22 +08:00
commit f505749144
2 changed files with 38 additions and 6 deletions

View File

@ -209,25 +209,25 @@ The ULP RISC-V core supports interrupt handling from certain internal and extern
* - EBREAK or ECALL or Illegal Instruction
- Internal
- 1
* - Unalligned Memory Access
* - Unaligned Memory Access
- Internal
- 2
* - RTC Peripheral Sources
- External
- 31
Interrupt handling is enabled via special 32-bit registers q0-q3 and custom R-type instructions. For more information, see *{IDF_TARGET_NAME} Technical Reference Manual* > *ULP Coprocessor* > *ULP-RISC-V* > *ULP-RISC-V Interrupts* [`PDF <{IDF_TARGET_TRM_EN_URL}>`__].
Interrupt handling is enabled via special 32-bit registers Q0-Q3 and custom R-type instructions. For more information, see *{IDF_TARGET_NAME} Technical Reference Manual* > *ULP Coprocessor* > *ULP-RISC-V* > *ULP-RISC-V Interrupts* [`PDF <{IDF_TARGET_TRM_EN_URL}>`__].
All interrupts are enabled globally during start up. When an interrupt occurs, the processor jumps to the IRQ vector. The IRQ vector performs the task of saving the register context and then calling the global interrupt dispatcher. The ULP RISC-V driver implements a *weak* interrupt dispatcher :cpp:func:`_ulp_riscv_interrupt_handler` which serves as the central point for handling all interrupts. This global dispatcher calls respective interrupt handlers which have been allocated via the :cpp:func:`ulp_riscv_intr_alloc`.
All interrupts are enabled globally during start-up. When an interrupt occurs, the processor jumps to the IRQ vector. The IRQ vector performs the task of saving the register context and then calling the global interrupt dispatcher. The ULP RISC-V driver implements a *weak* interrupt dispatcher :cpp:func:`_ulp_riscv_interrupt_handler` which serves as the central point for handling all interrupts. This global dispatcher calls respective interrupt handlers which have been allocated via the :cpp:func:`ulp_riscv_intr_alloc`.
Interrupt handling on the ULP RISC-V is not full featured yet. At present, interrupt handling for internal interrupt source is not supported. Support is provided for 2 RTC peripheral sources, viz., software triggered interrupt and RTC IO triggered interrupts. ULP RISC-V does not support nested interrupts. If users need custom interrupt handling then they may override the default global interrupt dispatcher by defining their own :cpp:func:`_ulp_riscv_interrupt_handler`.
Interrupt handling on the ULP RISC-V is not fully featured yet. At present, interrupt handling for internal interrupt sources is not supported. Support is provided for two RTC peripheral sources, viz., software-triggered interrupts and RTC IO-triggered interrupts. ULP RISC-V does not support nested interrupts. If users need custom interrupt handling then they may override the default global interrupt dispatcher by defining their own :cpp:func:`_ulp_riscv_interrupt_handler`.
Debugging Your ULP RISC-V Program
----------------------------------
When programming the ULP RISC-V, it can sometimes be challenging to figure out why the program is not behaving as expected. Due to the simplicity of the core, many of the standard methods of debugging, e.g., JTAG or ``printf``, are simply not available.
Keeping this in mind, here are some ways that may help you debug you ULP RISC-V program:
Keeping this in mind, here are some ways that may help you debug your ULP RISC-V program:
* Share program state through shared variables: as described in :ref:`ulp-riscv-access-variables`, both the main CPU and the ULP core can easily access global variables in RTC memory. Writing state information to such a variable from the ULP and reading it from the main CPU can help you discern what is happening on the ULP core. The downside of this approach is that it requires the main CPU to be awake, which will not always be the case. Keeping the main CPU awake might even, in some cases, mask problems, as some issues may only occur when certain power domains are powered down.

View File

@ -189,7 +189,38 @@ RTC I2C 控制器提供了在 RTC 电源域中作为 I2C 主机的功能。ULP R
* 如果 RTC I2C 中断状态日志报告 ``TIMEOUT`` 错误或 ``ACK`` 错误,则通常表示 I2C 设备未响应 RTC I2C 控制器发出的 ``START`` 条件。如果 I2C 从机设备未正确连接到控制器管脚或处于异常状态,则可能会发生这种情况。在进行后续操作之前,请确保 I2C 从机设备状态良好且连接正确。
* 如果 RTC I2C 中断日志没有报告任何错误状态,则可能表示驱动程序接收 I2C 从机设备数据时速度较慢。这可能是由于 RTC I2C 控制器没有 TX/RX FIFO 来存储多字节数据,而是依赖于使用中断状态轮询机制来进行单字节传输。通过在外设的初始化配置参数中设置 SCL 低周期和 SCL 高周期,可以尽量提高外设 SCL 时钟的运行速度,在一定程度上缓解这一问题。
* **你还可以检查在没有任何 ULP RISC-V 代码干扰和任何睡眠模式未被激活的情况下RTC I2C 控制器是否仅在主 CPU 上正常工作。** RTC I2C 外设在此基本配置下应该正常工作,这样可以排除 ULP 或睡眠模式导致的潜在问题。
* 调试问题的方法还包括确保 RTC I2C 控制器 **仅** 在主 CPU 上运行, **没有** ULP RISC-V 代码干扰,并且没有激活 **任何** 睡眠模式。这是确保 RTC I2C 外设正常工作的基本配置。通过这种方式,可以排除由 ULP 或睡眠模式可能引起的任何潜在问题。
ULP RISC-V 中断处理
------------------------------
ULP RISC-V 内核支持来自特定内部和外部事件的中断处理。设计上ULP RISC-V 内核可以处理以下来源的中断:
.. list-table:: ULP RISC-V 中断源
:widths: 10 5 5
:header-rows: 1
* - 中断源
- 类型
- IRQ
* - 内部定时器中断
- 内部中断
- 0
* - EBREAK、ECALL 或非法指令
- 内部中断
- 1
* - 非对齐内存访问
- 内部中断
- 2
* - RTC 外设中断源
- 外部中断
- 31
可通过特殊的 32 位寄存器 Q0-Q3 和自定义的 R-type 指令启用中断处理。更多信息,请参阅 *{IDF_TARGET_NAME} 技术参考手册* > *超低功耗协处理器* > *ULP-RISC-V* > *ULP-RISC-V 中断* [`PDF <{IDF_TARGET_TRM_CN_URL}>`__]。
系统启动时,默认启用所有中断。触发中断时,处理器将跳转到 IRQ 向量。IRQ 向量随即保存寄存器上下文并调用全局中断分发器。ULP RISC-V 驱动程序实现了一个 *弱* 中断分发器 :cpp:func:`_ulp_riscv_interrupt_handler`,充当处理所有中断的中心点。该全局分发器用于调用由 :cpp:func:`ulp_riscv_intr_alloc` 分配的相应中断处理程序。
ULP RISC-V 的中断处理尚在开发中,还不支持针对内部中断源的中断处理。目前支持两个 RTC 外设中断源,即软件触发的中断和 RTC IO 触发的中断,不支持嵌套中断。如果需要自定义中断处理,可以通过定义 :cpp:func:`_ulp_riscv_interrupt_handler` 来覆盖默认的全局中断调度器。
调试 ULP RISC-V 程序
----------------------------------
@ -211,6 +242,7 @@ RTC I2C 控制器提供了在 RTC 电源域中作为 I2C 主机的功能。ULP R
* ULP RISC-V 协处理器使用 bit-banged UART 驱动程序打印::example:`system/ulp/ulp_riscv/uart_print`.
* 主 CPU 处于 Deep-sleep 状态时ULP RISC-V 协处理器读取外部温度传感器::example:`system/ulp/ulp_riscv/ds18b20_onewire`
* 主 CPU 处于 Deep-sleep 状态时ULP RISC-V 协处理器读取外部 I2C 温度和湿度传感器 (BMP180),达到阈值时唤醒主 CPU:example:`system/ulp/ulp_riscv/i2c`.
* 使用 ULP RISC-V 协处理器处理软件中断和 RTC IO 中断::example:`system/ulp/ulp_riscv/interrupts`.
API 参考
-------------