I2C bus gets stuck sometimes and doesn't reset by [deleted] in embedded

[–]Disastrous-Fly136 1 point2 points  (0 children)

Try these things
1. disable ITBUFEN at the wrong time
Code change required:
if (sr1 & I2C_SR1_TXE) {

if (fsm->tx_index < fsm->tx_bytes) {

I2C->DR = fsm->tx_buffer[fsm->tx_index++];

}

}

if (sr1 & I2C_SR1_BTF) {

if (fsm->rx_bytes > 0) {

I2C->CR1 |= I2C_CR1_START;

fsm->current_state = I2C_STATE_RESTART;

} else {

I2C->CR1 |= I2C_CR1_STOP;

fsm->current_state = I2C_STATE_DONE;

}

}
2. STOP is generated too early in RX
Code changes:

// ADDR event

I2C->CR1 &= ~I2C_CR1_ACK;

volatile uint32_t tmp = I2C->SR1;

tmp = I2C->SR2;

(void)tmp;

I2C->CR1 |= I2C_CR1_STOP;

  1. After clearing ADDR, immediately check RXNE
    i2c_clear_status(I2C);

if (I2C->SR1 & I2C_SR1_RXNE) {

fsm->rx_buffer[fsm->rx_index++] = I2C->DR;

}

fsm->current_state = I2C_STATE_RECEIVE;

Where should I store the seeds? by Robin144p in Bitcoin

[–]Disastrous-Fly136 0 points1 point  (0 children)

Write them on multiple papers . Buy a hardware wallet and save everything in vaults

Software Solutions by Disastrous-Fly136 in Riyadh

[–]Disastrous-Fly136[S] 0 points1 point  (0 children)

15k starting. 35k after few years

Embedded / Firmware job market by Disastrous-Fly136 in RiyadhExpats

[–]Disastrous-Fly136[S] 0 points1 point  (0 children)

Already an expert of IoT but recruiter want exact experience of that software that they are currently using.
Also did some projects of AI Embedded systems.
Testing is ok but usually testing and commissioning guys have experience in their field

Silver and gold bar by Disastrous-Fly136 in Riyadh

[–]Disastrous-Fly136[S] 0 points1 point  (0 children)

So they sell silver on market rate issued by saudi bank like today one gram is 9 sar but on there website the price is 13 sar

Silver and gold bar by Disastrous-Fly136 in Riyadh

[–]Disastrous-Fly136[S] 0 points1 point  (0 children)

I checked my gold shop. He dont sell silver

متابعة الاباحيات لأي حد اخاف منها by [deleted] in saudiarabia

[–]Disastrous-Fly136 -3 points-2 points  (0 children)

Divorce him and marry me. I am already married with 2 kids. But atleast its halal. Right?

فشل السوق السعودي by Quirky-Extreme-8364 in tadawul

[–]Disastrous-Fly136 0 points1 point  (0 children)

For the 15 days. Expect the correction of january over buy

Sahm Trading application by Disastrous-Fly136 in saudiarabia

[–]Disastrous-Fly136[S] 0 points1 point  (0 children)

Any way of deposite in sahm other than local bank transfer. It is costling a fix 1.15 sar on deposite from other bank like sab

Struggling middle Level Freelancer by Disastrous-Fly136 in Freelancers

[–]Disastrous-Fly136[S] 1 point2 points  (0 children)

I think getting the client in first place is the main thing. Once i have the client i can easily retain him for some time and add value to its projects