Azure RTOSでRXマイコンが使えるようになったのですね

こんにちは。NoMaYです。

Azure RTOSでRXマイコンが使えるようになったのですね。コンパイラはGNURXが使われていました。

Getting started with the Renesas Starter Kit+ for RX65N-2MB (英文です。)
02/05/2021 Ryan Winter
docs.microsoft.com/ja-jp/samples/azure-rtos/getting-started/getting-started-with-the-renesas-starter-kit-for-rx65n-2mb/
 

Parents
  • なお、Context Switching割り込みですが、以下の部分で割り込み許可の窓を開けているようです。RXコアをWAIT状態に入れる前処理の`おまじない`としてでしょうか。ちがうかな、よくよく見ると、割り込み処理内でループしているようですので、WAITがどうのこうの関係無しに、ユーザ割り込み全般を待ち受けるような構造なのかな。

    続く?

    libs/threadx/ports/rxv3/ccrx/src/tx_thread_schedule.src (1つ前の投稿の最後のソースの前半です)

    ;VOID   _tx_thread_schedule(VOID)
    ;{
        .GLB __tx_thread_schedule
    __tx_thread_schedule:
    ;
    ;
    ;    /* Wait for a thread to execute.  */
    ;    do
    ;    {
        MOV.L    #__tx_thread_execute_ptr, R1        ; Address of thread to executer ptr
    __tx_thread_schedule_loop:
        SETPSW I                                     ; Enable interrupts
        CLRPSW I                                     ; Disable interrupts
        MOV.L    [R1],R2                             ; Pickup next thread to execute
        CMP      #0,R2                               ; Is it NULL?
        BNE      __tx_thread_thread_ready            ; Not NULL, schedule the thread
                                                     ; Idle system - no thread is ready    
    .IF TX_LOW_POWER==1
        MOV.L    #__tx_thread_preempt_disable, R1    ; Load prempt disable flag.
        MOV.L    [R1], R2
        ADD         #1, R2                              ; Disable preemption while enter/exit
        MOV.L    R2, [R1]
        BSR      _tx_low_power_enter                 ; Possibly enter low power mode
    .ENDIF

    .IF TX_ENABLE_WAIT==1
        WAIT                                         ; Wait for interrupt
    .ENDIF

    .IF TX_LOW_POWER==1
        CLRPSW I                                     ; Disable interrupts (because WAIT enables interrupts)
        BSR      _tx_low_power_exit                  ; Possibly exit low power mode
        MOV.L    #__tx_thread_preempt_disable, R1    ; Load prempt disable flag.
        MOV.L    [R1], R2
        SUB         #1, R2                 ; Enable preemption
        MOV.L    R2, [R1]
        MOV.L    #__tx_thread_execute_ptr, R1        ; Address of thread to executer ptr
    .ENDIF

        BRA      __tx_thread_schedule_loop           ; Idle system, keep checking

    __tx_thread_thread_ready:
    ;
    ;    }
    ;    while(_tx_thread_execute_ptr == TX_NULL);
    ;    
    ;    /* Yes! We have a thread to execute. Note that interrupts are locked out at this point.  */
    ;
    …以後省略…

     

Reply
  • なお、Context Switching割り込みですが、以下の部分で割り込み許可の窓を開けているようです。RXコアをWAIT状態に入れる前処理の`おまじない`としてでしょうか。ちがうかな、よくよく見ると、割り込み処理内でループしているようですので、WAITがどうのこうの関係無しに、ユーザ割り込み全般を待ち受けるような構造なのかな。

    続く?

    libs/threadx/ports/rxv3/ccrx/src/tx_thread_schedule.src (1つ前の投稿の最後のソースの前半です)

    ;VOID   _tx_thread_schedule(VOID)
    ;{
        .GLB __tx_thread_schedule
    __tx_thread_schedule:
    ;
    ;
    ;    /* Wait for a thread to execute.  */
    ;    do
    ;    {
        MOV.L    #__tx_thread_execute_ptr, R1        ; Address of thread to executer ptr
    __tx_thread_schedule_loop:
        SETPSW I                                     ; Enable interrupts
        CLRPSW I                                     ; Disable interrupts
        MOV.L    [R1],R2                             ; Pickup next thread to execute
        CMP      #0,R2                               ; Is it NULL?
        BNE      __tx_thread_thread_ready            ; Not NULL, schedule the thread
                                                     ; Idle system - no thread is ready    
    .IF TX_LOW_POWER==1
        MOV.L    #__tx_thread_preempt_disable, R1    ; Load prempt disable flag.
        MOV.L    [R1], R2
        ADD         #1, R2                              ; Disable preemption while enter/exit
        MOV.L    R2, [R1]
        BSR      _tx_low_power_enter                 ; Possibly enter low power mode
    .ENDIF

    .IF TX_ENABLE_WAIT==1
        WAIT                                         ; Wait for interrupt
    .ENDIF

    .IF TX_LOW_POWER==1
        CLRPSW I                                     ; Disable interrupts (because WAIT enables interrupts)
        BSR      _tx_low_power_exit                  ; Possibly exit low power mode
        MOV.L    #__tx_thread_preempt_disable, R1    ; Load prempt disable flag.
        MOV.L    [R1], R2
        SUB         #1, R2                 ; Enable preemption
        MOV.L    R2, [R1]
        MOV.L    #__tx_thread_execute_ptr, R1        ; Address of thread to executer ptr
    .ENDIF

        BRA      __tx_thread_schedule_loop           ; Idle system, keep checking

    __tx_thread_thread_ready:
    ;
    ;    }
    ;    while(_tx_thread_execute_ptr == TX_NULL);
    ;    
    ;    /* Yes! We have a thread to execute. Note that interrupts are locked out at this point.  */
    ;
    …以後省略…

     

Children
No Data