We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I'm programming a OS for C167 and my problem is that the C167 does write with putchar, but when I want to write with printf it only prints the first character of the string. For example:
void initSerial(void) { P3 |= 0x0400; DP3 |= 0x0400; DP3 &= 0xF7FF; S0TIC = 0x80; S0RIC = 0x00; S0BG = 0x40; S0CON = 0x8011; } void main (void) { int i; initSerial(); while(1) { for(i = 0; i < 20; i++) { putchar('c'); } for(i = 0; i < 20; i++) { printf("s"); } } }
This is typically a problem of the memory configuration. printf requires USERSTACK whereas putchar does not need any USERSTACK. Make sure that the user stack is located to a valid RAM space in your hardware. Reinhard