Skip to content

Lab6 UART 結束後 firmware 無法繼續執行指令 #166

Answered by boledulab
Russ420 asked this question in Q&A
Discussion options

You must be logged in to vote

few comments:

  1. UART loop should be run in parallel with fir/matmul/qs.
  2. In testbench, fork two processes: one is doing uart :send_data_2 , another is doing fir/matmul/qs
    in the task uart: send_data, we may wait random delay to send data. This is to let interrupt happen at any time when CPU execute fir/matmul/qs
  3. In firmware code, enable irq as early as possible. so that we won't lose uart rx interrupt.
    mask = irq_getmask();
    mask |= 1 << USER_IRQ_0_INTERRUPT; // USER_IRQ_0_INTERRUPT = 2
    irq_setmask(mask);
    // enable user_irq_0_ev_enable
    user_irq_0_ev_enable_write(1);
  4. Try to use different mprj code (AB60, AB61) to indicate which part of code is running.
  5. Note: since interrupt generated randomly…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@Russ420
Comment options

Comment options

You must be logged in to vote
2 replies
@Russ420
Comment options

@ZGCiou
Comment options

Comment options

You must be logged in to vote
1 reply
@Russ420
Comment options

Answer selected by Russ420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants