There are several anecdotal observations about colored soldiers in the confederate ranks. It is one of those subjects that has people hyperventilating before the discussion even begins. A question I have asked for years -- without getting a good response -- is this: how does one account for mixed race men in this discussion? The South had a substantial mixed race population. Some were slave; some were free. And they would have ranged in color from black to "light enough to pass," with most somewhere in between. They were, in the language of the period, mulattos, quadroons, and octoroons. Some had Indian blood mixed in as well. At the risk of sounding like an SJW snowflake, race isn't a binary condition, not now and not then.
So: what counts as "black?"
Remember also that it was not unusual for slaveowners to manumit their slaves, sometimes upon their death but occasionally before. Sometimes this was merely humanitarian. But not infrequently, it was a matter of a slaveowner manumitting his own children. The peculiar institution did get peculiar at times. I can easily imagine a slaveowner not wanting his own flesh and blood to possibly be whipped, beaten or raped by strangers after his death. One guesses that he might have used his slave children decently while he was alive but would be apprehensive about their future prospects. Better to free them.
The usual statement is that about ten percent of the "black" people in the South, however they were defined, were free. In the South's overwhelmingly agrarian society, this meant that free people of mixed race were living in rural communities alongside other people who may have been white but who were, in fact, cousins, second cousins, or more distant relations. And in a rural society, everyone would have known it. People would have known perfectly well that their grandfather or great grandfather was sleeping around, and across the color line. They knew who their cousins were on the other side of the line.
I recall a conversation with an historian who had been working with regimental muster rolls. These were of regiments in eastern and central Tennessee, thus the hill country, not the plantation belt. In these he found a scattering of men listed as "free man of color." They're there. It would be interesting to know more about them. Some of them may have been undiluted African in heritage, but I've always imagined that the typical case was a free man of mixed blood who moved reasonably comfortably in white society -- bearing in mind that a lot of these white folks would have been his relations -- and who enlisted with his second and third cousins when the war began. (We're not talking about the planter aristocracy in their mansions; we're talking about a rural frontier society up in the hill country.) Two years later and a couple of hundred miles away, an observer would then spot "black confederates" in the ranks, and this observation then went on to confound historical arguments. But if we peel it back to the origin, it is not really very surprising.
Well... right away you should check to see which regiments they were because most East Tennesseans served the Union army, not the Confederacy, and that would almost certainly include any "free men of color."
The Confederacy put considerable efforts into suppressing and oppressing East Tennesseans support for Union, and that included in Western North Carolina the Shelton Laurel Massacre.