# Simulation stuck at \_\_bcc\_con\_outbyte routine

**URL:** <https://discourse.grlib.community/t/simulation-stuck-at-bcc-con-outbyte-routine/189>\
**Category:** NOEL-V\
**Created:** [26 August 2021 14:11 UTC](https://discourse.grlib.community/t/simulation-stuck-at-bcc-con-outbyte-routine/189 "2021-08-26T14:11:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcSB](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MarcSB](https://discourse.grlib.community/u/MarcSB)\
**Post date:** [26 August 2021 14:11 UTC](https://discourse.grlib.community/t/simulation-stuck-at-bcc-con-outbyte-routine/189/1 "2021-08-26T14:11:33Z")

</div>

Hello,  
I’m simulating the NOEL-V (RV32) using the tiny configuration in the _noelv-generic_ design. The code has been compiled using the NCC toolchain provided [here](https://www.gaisler.com/index.php/products/sw-noel-overview) (linux).  
The program gets stuck in a loop in _\_\_bcc\_con\_outbyte_, apparently waiting for the UART. The rest of the program works as expected as I can successfully run programs that do not print any value.

Do you have any idea of what could be the issue and how can I resolve it? I include a screenshot with the system information and one with the simulation disassembly with the mentioned situation.

Thanks for your help!

 ![noelvinfo](https://europe1.discourse-cdn.com/flex017/uploads/grlib/original/1X/f4f9ca137241060e13a06081ca620e53efb3f30b.png)

 ![imatge_2021-08-26_155921](https://europe1.discourse-cdn.com/flex017/uploads/grlib/original/1X/4c1d286da9ef8c269823dc2085b60686fed5f426.png)

---

<div class="post-metadata">

**Author:** ![nils](https://avatars.discourse-cdn.com/v4/letter/n/d6d6ee/32.png) [@nils](https://discourse.grlib.community/u/nils)\
**Post date:** [30 August 2021 12:12 UTC](https://discourse.grlib.community/t/simulation-stuck-at-bcc-con-outbyte-routine/189/2 "2021-08-30T12:12:39Z")

</div>

Hi MarcSB,

Only considering you problem description (no deep analysis of the problem) I would say it could be that the UART is not enabled. You could try including the following function when compiling you main C code to enabling the UART:

```auto
void __bcc_init70(void){
  unsigned int * apbuart_ctrl = (unsigned int*)0xfc001008;

  // enable UART
  *apbuart_ctrl = 0x3;
}

int main() {
...
}

```

Please note: this should be ok for simulation, but when running the application on hardware using GRMON you may need to preserve some debug bits in the UART control register.

Regards,  
Nils

---

<div class="post-metadata">

**Author:** ![MarcSB](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@MarcSB](https://discourse.grlib.community/u/MarcSB)\
**Post date:** [30 August 2021 13:15 UTC](https://discourse.grlib.community/t/simulation-stuck-at-bcc-con-outbyte-routine/189/3 "2021-08-30T13:15:41Z")

</div>

Hi Nils,  
Including the function has solved the issue.  
Thank you!

Regards,  
Marc
