In general you can't use the same peripheral from multiple CPUs.
For the specific case of the UART you are probably having interrupt problems. The first CPU puts some characters into the UART and then enables interrupts so it can find out when the buffer has emptied. When the interrupt occurs both CPUs will race to service it - it's random which one gets there first. The CPU which doesn't win the race will see a spurious interrupt and have undefined behaviour.
If you select "use small drivers" then you will get the polled (non interrupt-driven) UART driver which won't suffer from these problems - but there will still be races between the CPUs which will occasionally lose characters.
The only safe way to do this is to use two UARTs or one UART protected by a mutex, although the latter will still have problems with where received characters go to.