This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] UCD3138064:"void swi_single_entry (uint32 arg1、uint32 arg2、uint32 arg3、uint8 swi_number)的含义是什么;"在 ucd3138中?

Guru**** 2460850 points
Other Parts Discussed in Thread: UCD3138

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/671725/ucd3138064-what-is-the-mean-of-void-swi_single_entry-uint32-arg1-uint32-arg2-uint32-arg3-uint8-swi_number-in-ucd3138

器件型号:UCD3138064
主题中讨论的其他器件:UCD3138

 ucd3138中"void swi_single_entry (uint32 arg1、uint32 arg2、uint32 arg3、uint8 swi_number);"的含义是什么?

bootloader?中的函数是什么  

谢谢

 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    感谢您的提问。 相应的工程师会对其进行研究。
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    对于 CCS 3.3、我们有多个软件中断入口点、它们利用了软件中断指令的功能、即在  指向寄存器的指令中提供立即字节。

    当我们转到 CCS 6时、我们无法确定如何执行该操作。  因此、我们切换到单个入口点、调用加载的值为 swi_number。

    我们还添加了软件中断包装程序。  下面是新的 software_interrupt.h 的一点:

    #pragma SWI_ALIAS (swi_single_entry、0)
    void swi_single_entry (uint32 arg1、uint32 arg2、uint32 arg3、uint8 swi_number);
    software_interrupts.h

    void ERASE_DATA_FLASH_SEGMENT (UINT8段);

    现在、swi_single_entry 是唯一的软件中断入口点、其立即字节值为零。  

    旧软件 interrupt.h 用于如下所示:

    software_interrupts.h
    #pragma SWI_ALIAS (ERASE_DATA_FLASH_SECTION、0)
    void ERASE_DATA_FLASH_SEGMENT (UINT8段);

    #pragma SWI_ALIAS (ERASE_dFLASH_SEGM_NO_DELAY、1)
    void ERASE_dFLASH_SECURE_NO_DELAY (UINT8段);

    #pragma SWI_ALIAS (WRITE_DATA_FLASH_WORD、3)
    void write_data_flash_word (unsigned long * address、unsigned long 数据);

    #pragma SWI_ALIAS (ENABLE_FAST_INTERRUPT、4)
    void enable_fast_interrupt (void);……

    这样、我们就可以直接使用立即字节。  使用 CCS 6、我们通过输入与 函数参数相同的数字并使用软件中断包装程序通过单个条目对所有内容进行仿真:

    software_interrupts.h
    空 ERASE_DATA_FLASH_SEGMENT (UINT8段)

        Swi_single_entry (段、0、0、0);


    空 ERASE_dlflash 段_NO_DELAY (uint8段)

        Swi_single_entry (段、0、0、1);


    void write_data_flash_word (uint32地址、无符号长整型数据)

        Swi_single_entry (地址、数据、0、3);


    void enable_fast_interrupt (void)

        Swi_single_entry (0、0、0、4);

    软件中断指令有一个字节(在 Thumb 模式中)、或者更多位(在 ARM 模式中)。  在 CCS3中、我们可以使用汇编指令来访问它:

     asm (" LDRB R3、[R14、#-1]");//get swi number into R3 as fourth 操作数

    在 CCS 6中、R14似乎不再指向 SWI 指令、因此我们无法使用此技巧。  因此、我们使用单入口点将相同的值显式放入第四个操作数中。  

    信息可能太多。  

    您可以看到、第四个操作数在 switch 语句中用于确定软件中断执行的函数。  

    #pragma SWI_ALIAS (swi_single_entry、0)

    void swi_single_entry (uint32 arg1、uint32 arg2、uint32 arg3、uint8 swi_number);

    software_interrupts.h

    void ERASE_DATA_FLASH_SEGMENT (UINT8段);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    感谢您的回复。