Portuguese trade with West Africa wasn't based on direct trade, as in our understanding of mercantilist economic history, where produce from Portugal were exported to Africa.
To increase its national wealth, Portuguese expanded by colonising northern and western Africa, via a multistage endeavour of conquest, mixed with trading with the hinterland of Africa. By conquering Cape Verde islands, for instance, cotton produced there were used as currency (as well as exported as commodity) to buy imports, including slaves from Western Africa. Thus, began the Atlantic Slave trade.
1. Gold via Conquest (Ceuta)
As the first stage, it began with Portuguese expansion into North Africa in 1415 by invading Ceuta. Chosen for its good anchorage, its location on north coast of Africa (Morocco) allowed Portugal to establish its first colony in Africa against the Marinid sultanate. Today, it's under Spanish authority. This was the first stage and it gave them access to gold from North Africa. There wasn't any export from Portugal, because they took gold by military means, namely via tribute or booty from North Africans.
From A History of Portugal and the Portuguese Empire - From Beginnings to 1807, vol 2 (2009), p. 14:
Portuguese service nobles hoped expansion into Morocco would bring
them gains in the forms of both honour in battle and windfall riches.
Those who went on to serve in the garrisons aimed for the same
benefits by participating in the perennial ‘little war’ – raids and
ambushes in which stout deeds were done and prisoners, cattle or other
prizes taken. The ‘little war’ provided opportunities for young
noblemen to build up their service records so they could then claim
doações and mercês from the crown. In the vicinity of the Portuguese
fortresses in northern Morocco there were various tributary villages,
a number of which were granted out as doações by Joao I or his
successors. It also became the accepted practice for one-fifth of the
tributes payable by pacified Muslims – the so-called mouros de paz –
to be given to the relevant fortress captains. More doacoes were later
distributed by Afonso V following renewed expansion in the 1470s.
More details, including a discussion on why Ceuta was chosen, is available in Chapter 17: Engaging with Atlantic Africa.
1.a. Portugal's Need for Gold
The purpose of introducing Ceuta and gold importation was to explain Portugal's lack of economic strength. I did not mean that gold was used to trade with Africa. As raised in comment, Portuguese trade with Africa did not involve exporting gold. Ceuta was a base for the hinterland of Africa to import or take gold. It was never sold back to Africa. In fact, the Portuguese crown's monetary need for gold was severe. Ibid, pp.13-4:
The capture of Ceuta gave Portugal access to gold imported via the Saharan caravans from West Africa, enabling the royal mint to strike gold coins for the first time for over fifty years. This was an important step forward because since the mid-thirteenth century Portugal had experienced great difficulty in acquiring gold. In its earlier years, the kingdom had obtained what supplies it could of the yellow metal mainly from Gharb al-Andalus through trade, tribute or booty; but this source disappeared when the Portuguese Reconquest was completed. Meanwhile the Roman mines at Tres Minas had long since been abandoned, and in early Avis times only negligible quantities of alluvial gold were being extracted from the sands of the lower Tagus. But Ceuta had long imported gold overland from sub-Saharan Africa and was famous for its gold ceiti or Ceuta doubloon. After conquering Ceuta in 1415 the Portuguese tapped into the same West African sources of supply, and eventually in 1436 King Duarte was able to introduce a new Portuguese gold coin called the escudo, as part of a major monetary reform program. Although the escudo was a relatively low-quality coin of only eighteen carats, it both stimulated commerce and boosted Duarte’s prestige. As Magalhães Godinho has shown, its production can be explained only by the Portuguese occupation of Ceuta.
2. Wine Production in Canary Islands
After conquering the Canary Islands, Portugal's need for imported slaves were for sugarcane plantations in the Canaries initially, but they gradually developed a wine production which brought them great wealth.
From Portugal and Africa (1999), pp 3-4:
The second stage of Portuguese expansion therefore attempted to
establish a wine industry overseas. The necessary skills were
available in the wine industry of Portugal. But Portuguese domestic
wine, like Portuguese grain, suffered from severe problems of cartage
to the coast. Even in the eighteenth century, when port wine became a
lucrative export, the shooting of the rapids on the Douro river made
transport almost suicidal. The prospect of using colonial islands for
the growing of vines was therefore attractive. The territory chosen
was the Canary Islands, off the Moroccan coast of Africa.
... Unlike the Azores, the Canaries were already inhabited and
conquest was necessary before plantations could be established. Once
conquered, however, the surviving islanders could be compelled to
slave servitude. Migrants from Portugal's impoverished backlands
sailed in to create vineyards using both local and mainland slaves.
Even when the colony was transferred in 1479 from Portuguese
suzerainty to control by the Crown of Castile, Portuguese immigrants
continued to provide many colonists for Tenerife.
A very good book on Portuguese and Castilian administration of the Canaries, which I do not have anymore and therefore cannot reference, is The Canary Islands after the Conquest: The Making of a Colonial Society in the Early Sixteenth Century (1982).
3. Cotton from Cape Verde Islands
From Portugal and Africa, p.4:
The third stage of Portuguese experimentation in colonial practices
was focused on another set of Atlantic islands, the Cape Verde
islands. The Cape Verdes became famous over time for their textile
industry. Portugal was almost as severely short of textiles as it was
short of wheat. One reason for the development of wine exports was to
pay for woollen materials from England. Cotton was also bought in
significant quantities from Muslim suppliers in north Africa and,
after the rounding of the Cape of Good Hope, from the great textile
industries of India. But the Cape Verde islands offered an opportunity
to create a colonial textile industry.
Cotton and indigo plantations were established on the islands for
spinning and dyeing. Labour was purchased on the West Africa mainland.
Craftsmen were also brought over from the mainland to introduce the
necessary weaving skills. The styles of textile adopted were those
which would sell best in Africa. The industry soon became
self-perpetuating. Cloth woven in the islands was sold on the mainland
in return for more slaves who would further expand the plantations.
The only European input was sea transport. The Portuguese shipped
cloth up and down the coast in the cabotage trade.
An interesting article from 1982 on agriculture in Cape Verde islands: The Evolution OF Cape Verde's Agriculture (African Economic History).
4. Cotton as Currency
The value of cotton was not its use merely as a commodity, but also as currency.
From Money in Africa (2009), p.9:
In the geography of pre-colonial currencies in West Africa, Senegambia
was the heart of a cloth-currency territory. The use of cloth strips
as money was well established by the 16th century and the use of cloth
as money was still expanding in the 18th century. It is also clear
that many other commodity currencies were in use alongside cloth:
cattle were a standard of value in the north of this zone; dates were
sometimes used in the Sahara; measures of millet were common in the
Sahel, and bars of salt were used at certain times in the interior. As
discussed in this chapter, much of the cloth currency was made locally
in Senegambia, and increasingly also in the Cape Verde Islands.
Locally-made cloth used as money was called pagne in Senegalese
French, country cloth in Gambian English, soro in Pulaar, tama in
Soninke, and panos in Portuguese. This cloth money was the dominant
currency along the upper Guinea coast when the Portuguese first
arrived, and it had spread eastward along the sahel and throughout
much of the region of Mandinka and Fulbe culture. When soro was first
used in the Fuuta Jallon highlands is not known, but the Fulbe made it
the dominant currency there in the 18th century. Cloth currency had
spread to the coastal zone well before the 18th century and was even
produced in the Cape Verde Islands by the 16th century.
... Information on cotton cultivation in the Cape Verde Islands
demonstrates that the use of cloth strips as money on the upper Guinea
coast was well established by the late 15th century. Indeed the growth
of a local industry to produce cloth strips in the Cape Verde Islands
was closely associated with Portuguese trade on the upper Guinea coast
and the Rivers of Guiné, it also competed with locally produced cloth
for use as a currency.
In all of these transactions, Portugal had an extensive tariff (tax) policy to generate income for the crown/government - Portugal in a European Context - Taxation and Fiscal Policies in Late Medieval and Early Modern Western Europe, 1100-1700 (2023).